batch substitution carriage return text file

September 3, 2010 at 03:59:33
Specs: Windows XP, 1 Gb
is it possible to substitute in a text file what I'm presuming the carriage return linux style (appearing as a "small empty square") with corrispondent windows character by mean of a batch procedure?
How to handle that problem by means of ascii codes?
any help?

See More: batch substitution carriage return text file

Report •

September 3, 2010 at 04:39:25
Not clear.

You need to specify exactly what and where it is.

Use debug or a hex viewer.

Helping others achieve escape felicity


Report •

September 3, 2010 at 05:02:13
I need that that lines in my text file be separated by vbCr or vbCrLf (ASCII 13) characters. Because the file under question uses vbLf characters (ASCII 10) (Hex 0A, I presume), as is often the case with file created on non-Windows platforms, I need to convert the vbLf characters to vbCr characters. Is that possible by a batch?
Hope now is more clear, thanks for your reply

Report •

September 3, 2010 at 05:10:38
using vbscript, you can use replace() to replace vblf to vbcrlf

GNU win32 packages | Gawk

Report •

Related Solutions

September 3, 2010 at 05:13:47
Or just open the text file in Wordpad. Notepad seems to be the only Windows text editor out there that doesn't translate \n to \r\n.

EDIT: Rant aside, here's the easy way:

for /f "delims=" %%a in (bad.txt) do >>out.txt @echo %%a

It might alter other data, though.

Report •

Ask Question