Feb 3, 2008 #1 globemast Programmer Joined Jun 24, 2006 Messages 7 Location CY Hello, I would like to delete the first 56 lines of a file that i have using AWK. Could you give me some help on this.. Thanks in advance.
Hello, I would like to delete the first 56 lines of a file that i have using AWK. Could you give me some help on this.. Thanks in advance.
Feb 4, 2008 #2 ranjit Technical User Joined Apr 14, 2000 Messages 131 Location GB [tt] Perhaps using an array: $ cat script {a[NR]=$0} END { for(i=57;i<=NR;i++) print a } $ awk -f script datafile [/tt] Upvote 0 Downvote
[tt] Perhaps using an array: $ cat script {a[NR]=$0} END { for(i=57;i<=NR;i++) print a } $ awk -f script datafile [/tt]
Feb 4, 2008 2 #3 geirendre Vendor Joined Aug 13, 2001 Messages 603 Location NO Code: awk 'NR > 56' /path/to/originalfile.txt > newfile.txt http://www.student.northpark.edu/pemente/awk/awk1line.txt HTH Upvote 0 Downvote
Code: awk 'NR > 56' /path/to/originalfile.txt > newfile.txt http://www.student.northpark.edu/pemente/awk/awk1line.txt HTH
Feb 4, 2008 Thread starter #4 globemast Programmer Joined Jun 24, 2006 Messages 7 Location CY Thanks geirendre, That worked fine. Thanks also to everyone else that replied to this question. Upvote 0 Downvote