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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

removing characters

Status
Not open for further replies.

abovebrd

IS-IT--Management
May 9, 2000
690
US
I have a data file with just over 1000 lines

I need to find a way to delete everything but the first 6 characters on each line. Using perl is not an option.

I was thing of using SED, however I am drawing a blank on the general expression right now. If you have a suggestion I would love to here it.

-Danny
dcd@pop.mainstreet.net



-Danny






 
Well its not pretty but it worked.

I opened the file with vi,

then used the search and replace function

1,$ s/.......(60 dots)$//g

Each line had a consitant number of characters which I failed to metion.

However there must be a better (cleaner) method for doing this ?

-Danny






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top