I tested my solution by using a sample text file called "new1.txt" which
contained a slew of lines like this:
"1 the quick brown fox jumped over the lazy dogs back".

The lines were labeled 1 thru 9 so I could see that they were all getting
read. The exact text of the solution adds "extra text" to the new file.
On my system the resulting new file called "new2.txt" contained the same
lines but modified like this:
"1 the quick brown fox jumped over the lazy dogs back extra text"

I'm on Windows 2000 sp4, nothing special there so if you are on W2k also
it should work the same. I can even email you the test files if you like.

I think it s taking the quote as part of the command rather than a character. I recall reading something about if you want to echo a quote you need a special

Message 2 of 12
, Jan 12, 2004

I think it's taking the quote as part of the command rather than a
character. I recall reading something about if you want to echo a quote
you need a special character in front of it so the command processor
doesn't think it's part of the command. I'll dig around and see if I can
find the proper syntax. Also, don't you want quotes at the front and
back? Seems odd to just end the line with a quote.

I think it's taking the quote as part of the command rather than a
character. I recall reading something about if you want to echo a quote
you need a special character in front of it so the command processor
doesn't think it's part of the command. I'll dig around and see if I can
find the proper syntax. Also, don't you want quotes at the front and
back? Seems odd to just end the line with a quote.

I tested my solution by using a sample text file called "new1.txt" which
contained a slew of lines like this:
"1 the quick brown fox jumped over the lazy dogs back".

The lines were labeled 1 thru 9 so I could see that they were all getting
read. The exact text of the solution adds "extra text" to the new file.
On my system the resulting new file called "new2.txt" contained the same
lines but modified like this:
"1 the quick brown fox jumped over the lazy dogs back extra text"

I'm on Windows 2000 sp4, nothing special there so if you are on W2k also
it should work the same. I can even email you the test files if you like.

I tested my solution by using a sample text file called "new1.txt" which
contained a slew of lines like this:
"1 the quick brown fox jumped over the lazy dogs back".

The lines were labeled 1 thru 9 so I could see that they were all getting
read. The exact text of the solution adds "extra text" to the new file.
On my system the resulting new file called "new2.txt" contained the same
lines but modified like this:
"1 the quick brown fox jumped over the lazy dogs back extra text"

I'm on Windows 2000 sp4, nothing special there so if you are on W2k also
it should work the same. I can even email you the test files if you like.

> Here's what I found:
>
> You can put a carat ^ before the quote to force it to be treated as text.
> Like this.....
> FOR /F "tokens=1* delims=" %%A IN (.\new1.txt) DO (echo %%A ^")>>new2.txt
>
> Hope that fixes it.
>
> Ken Mazie

That'll work, if there are no "special" characters within the text, and you
don't want to preserve blank lines.

>
> Let me explain a little further I need to add " at the end of each line.

It needs quotes converted to a Hexidecimal representation, and that & needs
to be escaped for NT.

sed 's/.*/^&\x22/' delme.txt>delme1.txt

If I understand it, the whole job could be done with

sed 's/.*/del \x22^&\x22/' delme.txt>delme1.txt

--
Regards,
Michael

Morris, Lamar

Thanks Michael, this did just what I needed, it put the del at the front of the line and at the end of the line. This save me an extra step. Lamar _____

Message 7 of 12
, Jan 13, 2004

Thanks Michael, this did just what I needed, it put the del " at the front
of the line and " at the end of the line. This save me an extra step.

> Here's what I found:
>
> You can put a carat ^ before the quote to force it to be treated as text.
> Like this.....
> FOR /F "tokens=1* delims=" %%A IN (.\new1.txt) DO (echo %%A ^")>>new2.txt
>
> Hope that fixes it.
>
> Ken Mazie

That'll work, if there are no "special" characters within the text, and you
don't want to preserve blank lines.

>
> Let me explain a little further I need to add " at the end of each line.

It needs quotes converted to a Hexidecimal representation, and that & needs
to be escaped for NT.