1.

Solve : need to replace strings from file?

Answer»

Hi

1. I NEED to replace blank space and . from text file to _
2. Also I need to be replace the string from a file to another string for EG (computer replace to hope)
3. There are 3 strings in a text file sepereted with , need to display the same on the command prompt


thanksdownload sed for windows,

Quote from: tinkuy on July 12, 2010, 03:25:32 AM

Hi

1. I need to replace blank space and . from text file to _
Code: [Select]c:\> sed "s/[ \t.]/_/g" textfile

Quote
2. Also I need to be replace the string from a file to another string for eg (computer replace to hope)
Code: [Select]c:\> sed "s/computer/hope/g" textfile
Quote
3. There are 3 strings in a text file sepereted with , need to display the same on the command prompt
Show samples of your text file next time, and explain clearly what your final output is.

Thanks but I would appreciate if it can be done using DOS command.

pls helpThis question has been asked and answered many times on the forum. You may have overlooked searching the forum before posting your question.

Also if you run set /? from the command prompt, the online HELP should be of immense help.

Showing some initiative trumps waiting for a response every time.



Discussion

No Comment Found