S scan macrumors 6502 Original poster Oct 24, 2005 344 0 Jul 19, 2006 #1 is there a way, using awk, to print fields x - x (ie $3 - $10)?
Sdashiki macrumors 68040 Aug 11, 2005 3,529 11 Behind the lens Jul 19, 2006 #2 Um what? i have no idea what this is, but I found it: http://www.vectorsite.net/tsawk.html
OutThere macrumors 603 Dec 19, 2002 5,730 3 NYC Jul 19, 2006 #3 How about giving us a little more, um, detail? It's pretty hard to help you when you don't tell us what you're trying to do.
How about giving us a little more, um, detail? It's pretty hard to help you when you don't tell us what you're trying to do.
Mitthrawnuruodo Moderator emeritus Mar 10, 2004 14,744 1,637 Bergen, Norway Jul 19, 2006 #4 Try man awk in Terminal.app
S scan macrumors 6502 Original poster Oct 24, 2005 344 0 Jul 19, 2006 #5 OutThere said: How about giving us a little more, um, detail? It's pretty hard to help you when you don't tell us what you're trying to do. Click to expand... awk is a command in unix. you can print fields/columns of a files by referring to them as $1 for field 1, $2 for field two, etc. instead of saying I want to print $1, $2, $3... i just want to print a range ie: fields 1-5
OutThere said: How about giving us a little more, um, detail? It's pretty hard to help you when you don't tell us what you're trying to do. Click to expand... awk is a command in unix. you can print fields/columns of a files by referring to them as $1 for field 1, $2 for field two, etc. instead of saying I want to print $1, $2, $3... i just want to print a range ie: fields 1-5
P PatrickF macrumors 6502 Feb 16, 2006 335 0 Blighty Jul 19, 2006 #6 You can do this with a for loop in awk. Try the following code: Code: { for (i = 1; i <= 5; i++) { printf "%s ", $i } printf "\n" } That will print fields 1 to 5 and add a newline after each line.
You can do this with a for loop in awk. Try the following code: Code: { for (i = 1; i <= 5; i++) { printf "%s ", $i } printf "\n" } That will print fields 1 to 5 and add a newline after each line.
S scan macrumors 6502 Original poster Oct 24, 2005 344 0 Jul 19, 2006 #7 PatrickF said: You can do this with a for loop in awk. Try the following code: Code: { for (i = 1; i <= 5; i++) { printf "%s ", $i } printf "\n" } That will print fields 1 to 5 and add a newline after each line. Click to expand... yeah thats what I ended up doing. I thought maybe there was a built in way to do this. thanks.
PatrickF said: You can do this with a for loop in awk. Try the following code: Code: { for (i = 1; i <= 5; i++) { printf "%s ", $i } printf "\n" } That will print fields 1 to 5 and add a newline after each line. Click to expand... yeah thats what I ended up doing. I thought maybe there was a built in way to do this. thanks.
d wade macrumors 65816 Jun 27, 2006 1,046 2 Boca Raton, FL Jul 19, 2006 #8 Sdashiki said: Um what? Click to expand... my thoughts exactly, lol