Results 1 to 3 of 3
hi! I have a file with more lines and columns but not all columns are the same.
For example:
this is a word
this is a big world
is this ...
- 10-16-2009 #1Just Joined!
- Join Date
- Oct 2008
- Posts
- 48
Question about AWK
hi! I have a file with more lines and columns but not all columns are the same.
For example:
this is a word
this is a big world
is this a very big world
etc..
How can I use awk to show the second and more character to the end?
I use this command actually:
how can i put the $3 to the end? (i don't say what's the end!)Code:more files.log | awk '{print "ls \"/home/" $1 "/" $2 "/\"*\"" $3 "\" | wc -l"}'
- 10-16-2009 #2
AWK has a built in variable that's NF, which is the number of fields each line has...
So the way to read the second last field would be $(NF - 1) the last $NFMake mine Arch Linux
- 10-18-2009 #3Just Joined!
- Join Date
- Oct 2008
- Posts
- 48
i don't have my linux now, but i try this reply.
So I don't know what's the number of fields have each line.
I give this information from a CSV file and I generate some commands to verify if the file exist or no.


Reply With Quote