LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   sed question (https://www.linuxquestions.org/questions/linux-software-2/sed-question-105871/)

zoomzoom 10-19-2003 08:18 AM

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

david_ross 10-19-2003 08:30 AM

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

mark2117 10-20-2003 04:04 PM

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


All times are GMT -5. The time now is 09:02 PM.