Awk : print certain column ranges
|
Original Message
|
Name: daelomin
Date: August 10, 2006 at 09:20:13 Pacific
Subject: Awk : print certain column rangesOS: LinuxCPU/Ram: P4 1gig |
Comment: Hi, How can one print columns say 4 to end with awk? Thanks
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: nails
Date: August 10, 2006 at 15:08:55 Pacific
|
Reply: (edit)Assume a default file delimited by whitespace; start at column 4 and print each column to the end. Print a CR at the end of each line: #!/bin/ksh awk ' { for (i=4; i<=NF; i++) printf("%s ", $i) printf("\n") # CR at end of line } ' mydatafile
Report Offensive Follow Up For Removal
|
Use following form to reply to current message: