Results 1 to 10 of 12
Hi ,
I'm trying to extract file names using cut from zip file ...what i did..
#unzip -l gg.zip > hi
#cat hi
Archive: gg.zip
Length Date Time Name
-------- ...
- 06-22-2007 #1
cut command -- problem
Hi ,
I'm trying to extract file names using cut from zip file ...what i did..
#unzip -l gg.zip > hi
#cat hi
Archive: gg.zip
Length Date Time Name
-------- ---- ---- ----
3447 11-23-06 17:01 gg/gg4_295_295.jpeg
3447 11-23-06 17:01 gg/sunnystyle_295_295.jpeg
3447 11-23-06 17:01 gg/aa_295_295 (copy).jpeg
3447 11-23-06 17:01 gg/zz_295_295 (another copy).jpeg
3447 11-23-06 17:01 gg/aa_295_295.jpeg
3447 11-23-06 17:01 gg/zz_295_295.jpeg
-------- -------
20682 6 files
# cut -f4 hi
Archive: gg.zip
Length Date Time Name
-------- ---- ---- ----
3447 11-23-06 17:01 gg/gg4_295_295.jpeg
3447 11-23-06 17:01 gg/sunnystyle_295_295.jpeg
3447 11-23-06 17:01 gg/aa_295_295 (copy).jpeg
3447 11-23-06 17:01 gg/zz_295_295 (another copy).jpeg
3447 11-23-06 17:01 gg/aa_295_295.jpeg
3447 11-23-06 17:01 gg/zz_295_295.jpeg
-------- -------
20682 6 files
--------------------------
cut f4 displays whole contents instead of displaying filename only....how to display file only....
thanks- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 06-22-2007 #2
there should be a space between -f and 4.
Code:cut -f 4 hi
It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 06-22-2007 #3
no...i gave space between -f and 1 ...even then i'm getting same output....it displays whole file....do i have 2 use any delimiter option with cut ????
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 06-22-2007 #4Code:
cut -f4 -d' ' hi
It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 06-22-2007 #5
Hi,
nope...even that's not working ....
if i give cut -f4 -d' ' hi
no output is disaplyed ...i attached that hi file..- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 06-22-2007 #6
hi file is attached here...
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 06-22-2007 #7
i think i found the root cause , the file(hi.txt) flieds are not sepated by TAB.....so -f is not working....how to fix this....
3447 11-23-06 17:01 gg/gg4_295_295.jpeg
there is 5 space before 3447 and
2 blank space between 3447 and 11-23-06
1 blank space between 11-23-06 and 17:01
3 blank space between 17:01 and gg/gg4_295_295.jpeg- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 06-22-2007 #8Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
You can solve this with awk:
RegardsCode:awk '{print $4}' hi.txt
- 06-22-2007 #9
...awk works....thanks..
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 06-22-2007 #10Linux Newbie
- Join Date
- Feb 2007
- Location
- hyderabad, india
- Posts
- 247
hi
if this is the case how can i print
how can i print bikes first and cars second..Code:__bikes__ a a@yahoo.com 111111111111 1234567890123456789044444 1234567890123456789055555 1234567890123456789022222 __ONLINE__ b b@gmail.com 111111111111 __cars__ c c@yahoo.com 111111111111 1234567890123456789088888 1234567890123456789088888 1234567890123456789088888
means output is simply like this
can you help me ..Code:name:a mail:a@yahoo.com h:1234567890123456789044444 m:1234567890123456789055555 o:1234567890123456789022222 name:b mail:b@yahoo.com h: m: o: name:c ----------- ---------- ----------- like this
"Relationships are built on trust and communication"


Reply With Quote
