![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| remove a line within a file | new2ss | UNIX for Dummies Questions & Answers | 3 | 1 Week Ago 11:34 AM |
| sed remove last 10 characters of a line start from 3rd line | minifish | Shell Programming and Scripting | 7 | 03-26-2008 01:42 PM |
| Copy all the files with time stamp and remove header,trailer from file | ksrams | UNIX for Dummies Questions & Answers | 35 | 07-30-2007 11:15 AM |
| How to remove last line of the file | mani_um | Shell Programming and Scripting | 3 | 05-14-2007 05:35 AM |
| Remove every third line from a file | bistru | Shell Programming and Scripting | 4 | 01-31-2006 04:26 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Remove header(first line) and trailer(last line) in ANY given file
Hi,
I need some help in removing the header (first line) and the trailer (last line) in a give file... The data file actually comes in EBCDIC format and I converted it into ASCII.. Now I need to strip off the first line and the last line.. I think we can use sed to do something like this: sed -n -e '2,964p' InPutFile.dat > OutPutFile.dat Since I know the file has 965 rows, I could do this...But I would like to automate this script.. Thank you, Madhu |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Try:
sed '1d;$d' |
|
#3
|
|||
|
|||
|
Thank you for the message. I was just wondering if we can do the same thing on EBCDIC data file which is fixed width. Can we remove the lines depending on the number of bytes in an EBCDIC file? Like remove 23 bytes in the beginning and 8 bytes at the end...
Thanks again, Madhu |
|||
| Google The UNIX and Linux Forums |