LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

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

Rep: Reputation: 15
sed question


Hi,

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!

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

Rep: Reputation: 64
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
mark2117
LQ Newbie
 
Registered: Sep 2003
Posts: 12

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

:%s/something//g

that will remove something in the entire file globally.

then

:w "new filename"

seems much easier.....to me..

Mark
 
  


Reply


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


All times are GMT -5. The time now is 01:42 AM.

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