Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cut, awk, sed, grep I am not sure what to use. 1

Status
Not open for further replies.

tijerina

Vendor
Mar 4, 2003
132
US
I have a file called FILELIST that has about 200 lines in it, when you cat FILELIST it looks like this:
/SYS3/PRDSCHED/SF257902
/SYS3/PRDSCHED/SF271902
/SYS3/PRDSCHED/SF272
/SYS3/PRDSCHED/SF282902
/SYS3/PRDSCHED/SF302902

I would like to go into this file called "FILELIST" and cut the characters that have files that are more than 21 characters per line. The results should look like this:

/SYS3/PRDSCHED/SF257
/SYS3/PRDSCHED/SF271
/SYS3/PRDSCHED/SF272
/SYS3/PRDSCHED/SF282
/SYS3/PRDSCHED/SF302

What I tried before was:
cat FILELIST | sed -c21- > FILETEMP
mv FILETEMP FILELIST

But this only gives me the cut pieces like shown below:
902
902
902
902

Any ideas????


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top