Computing.Net > Forums > Programming > Piping text within a batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Piping text within a batch file

Reply to Message Icon

Name: travellerandreas
Date: August 18, 2004 at 12:18:55 Pacific
OS: Win98 & ME
CPU/Ram: Athlon 2400 512Mb
Comment:

I am unable to pipe\rediret text within a single batch file with the intention that all text lines are available to ECHO and located at the end of the file. The batch files are used to backup six important applications and folders to a flashdrive. Drive E: is my working drive and intentionally not part of PATH.
The normal piping method of:
FIND /I "compl" <E:\tmp$$$ >E:\De$

is long winded, defeats the object to make things neater. In any case how do I extract the text from De$ to use in a batch file?

The line in E:\X.BAT:
FIND /I "compl" <E:\X.bat >E:\De$
Goto Again
The update is completed
Other text lines
Other text lines
:OUT

extracts the string "The update is completed"
and the FIND line use to find it! Again, I need to be able to echo that text within the batch file. I have attempted %%a, %A% etc etc but to no avail.

Any help would be appreciated


Gordon Williams




Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: August 19, 2004 at 00:11:33 Pacific
Reply:

Hi,

I guess that the lines you posred are incomplete.

If you want to echo somthing, first you turn echo off. Then you echo the text; like this:

@echo off
echo hello
echo test one

You have a goto again, but there's no again label.

It's pronanly not a good idea to redirect the bat being run.

If you post something more complete, we can get to the more difficult isse of using lines within a file to do other things.



0
Reply to Message Icon

Related Posts

See More


Close application Armstorng Number Programm...



Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Piping text within a batch file

Sorting within a batch file www.computing.net/answers/programming/sorting-within-a-batch-file/15059.html

Disable editing a batch file www.computing.net/answers/programming/disable-editing-a-batch-file/16914.html

using a text input in a batch file www.computing.net/answers/programming/using-a-text-input-in-a-batch-file/12980.html