Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello every1!!
Look, I need to remove all lines that say "Echo is off." from a text file using Batch.
How can I do this??
Thanx!! ;)El-Trucha

Hi
Try something like this.
type OldFile | find /v /i "Echo is off" > NewFileNewFile will contain every line minus the "Echo is off" lines.

Hi,
dtech is right.
But does you batch file really have such lines, or is it putting out 'echo is off'?
If echo is off and you have a line like this:
echo
with nothing else after it, it will put out the msg 'echo is off'
If that's the case and you really want a line which puts out a 'blank' line, use:
echo.
HTH
M2

No...I'm making a batch file which makes another batch file with user input, but the file gives the option to select which files to use.
For example,
------------------------
echo Do you want to put a welcome message??
choice /c:yn
if errorlevel 2 goto label
set /p message=What's your message gonna b??
...
echo %message%
------------------------
But the problem is that if %message% doesn't exist, it will say "Echo is off" on the output file!!! :(
So I will try that solutionn!! thanx!! ;)El-Trucha

Hi
You could use this to stop echoing the
"echo is off" statement.if not "%message%"=="" echo %message%

OK so lets say that you moved all of your music files from one folder to a dif. folder where the rest of your music files are. ya know, just doing some spring cleaning.. but then you have a winamp playlist that has the destination of half of your songs going to the wrong file and you have playlist thats lets say.. ooh.. 1000 songs long..
using the above method of removing the phrase "My Shared Folder" each time it appears actually deletes every line that it appears in, not just the phrase..
so is there a way that you could have a batch file delete just the "My Shared Folder" and/or replace the phrase with "My Music"?

yea, like if you open up a winamp playlist in notepad its just a lil info for winamp and then the file info for each song. on one line is like the \My Shared Folder\baby_got_back.mp3 or w/e

Ooohh...ok!! and u want 2 change My Shared Folder for My Music...hmm...I don't know...sorry... :(
El-Trucha

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |