S scan macrumors 6502 Original poster Jul 19, 2006 #1 is there a way, using awk, to print fields x - x (ie $3 - $10)?
Sdashiki macrumors 68040 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 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.
S scan macrumors 6502 Original poster 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 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 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 Jul 19, 2006 #8 Sdashiki said: Um what? Click to expand... my thoughts exactly, lol