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

cut 1

Status
Not open for further replies.

Tracy3e

Technical User
Jun 23, 2001
54
CA
Is there a way to cut up a file based on a word that is found in each line? I know you can cut on field position or delimeters but the only thing that is standard in this file is this one word that I'd like to base the cut on.

Or another similar command to cut?

Thanks
 
I hope you mean cut as in the cut utility. You can pass the file through sed and replace the word into a single character delimiter then use cut.

e.g:
cat some_file | sed s/some_word/#/g | cut --delimiter="#" -f some_column


--== Anything can go wrong. It's just a matter of how far wrong it will go till people think its right. ==--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top