Re: Oops - I ran into a problem trying to use DOS to write to an html file


[ Follow Ups ] [ Post Followup ] [ The EasyDOS Forum ] [ FAQ ]

Posted by JB on April 01, 2008 at 14:32:28:

In Reply to: Re: Oops - I ran into a problem trying to use DOS to write to an html file posted by 20080331 on March 31, 2008 at 14:16:37:

: : Thanks for the help I got on this forum when I
: : asked about using a DOS batch program to write
: : to a file. I was able to use FOR to append lines
: : of info to a file, but when I tried to append
: : info to an html file, the angle brackets in HTML
: : (for example xxx) seem to mess up the FOR
: : sequence. No part of the FOR sequence will work
: : and it reports a FILE NOT FOUND error. Obviously
: : it is interpreting the angle brackets in some
: : way (as a file name?). If I put the
: : angle-bracketed word in quotes, the FOR sequence
: : will work until it reaches that point and then
: : it stops. If I put the angle-bracketed word in
: : double quotes, the batch file works, but it
: : completely ignores the angle-bracketed word. It
: : does not write it to the file. The sequence goes
: : right on as if it wasn't there at all. Is there
: : any way to write an angle bracket to a file?

: ##

: Note: Change the curly braces in the following to angle brackets.

: --

: Command:

: for %x in (apple "{orange}" pear) do echo %x >> fubar.txt

:
: Contents of "fubar.txt":

: apple
: "{orange}"
: pear

Doesn't work on my WIN 98 system, but it DOES work on my WIN XP system. Odd.

Let's see if I've got it right. Here's a description of what I put in my batch file:

for %%x in (apple quotemark lessthananglebracket orange greaterthananglebracket quotemark pear) do echo %%x >> fubar.txt

On the WIN 98 computer it does write the word apple to the fubar.txt file, but then it bombs with a FILE NOT FOUND error.

Any idea why it works on XP DOS but not on WIN98 DOS?


Follow Ups:



Post a Followup (use TAB key to move between boxes - NOT ENTER or RETURN)

Name:
E-Mail:

Subject:

Type your comments in the box below and SUBMIT:


[ Follow Ups ] [ Post Followup ] [ The EasyDOS Forum ] [ FAQ ]