Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 10-19-2003, 08:18 AM   #1
Registered: Aug 2003
Posts: 55

Rep: Reputation: 15
sed question


i have a file with the following format:

'something' -> 'something new'

I now want to write only the 'something new' in a different file (i want to cut off the whole "'something' -> " in every line).
Any ideas which program would do this best/easiest, sed or cut (or any other?)? I haven't worked with any of them for now...

THank you!

Old 10-19-2003, 08:30 AM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
If you just want to remove "something" when it is at the beginning of the line then try:
sed 's/^something//g' /path/to/file
Old 10-20-2003, 04:04 PM   #3
LQ Newbie
Registered: Sep 2003
Posts: 12

Rep: Reputation: 0
Hmmm, why not just open the "something file" in vi and do this


that will remove something in the entire file globally.


:w "new filename"

seems much me..



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
sed question ckoniecny Linux - General 3 11-11-2005 09:31 AM
question on sed tifu Linux - Newbie 3 03-18-2005 04:38 PM
sed question virendratp Programming 3 09-10-2004 03:21 AM
sed question dolvmin Linux - Software 4 03-09-2004 09:27 AM
little sed question freelinuxcpp Linux - Software 3 01-20-2004 07:36 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration