Batch command to add car return to txt files

September 30, 2010 at 14:49:42
Specs: Windows XP
I have a set of text files I want to concatenate, but the files do not have the last "car return", so every time I run:
copy *.txt allmyfiles.txt
the first line of the following file copied is appended at the end (on the right side) of the previous file's last line.
Does anybody know an easy way to add the missing "car return" in each file before I try to copy them?

See More: Batch command to add car return to txt files

Report •

#1
September 30, 2010 at 15:02:09
Try:
copy /a *.txt allmyfiles.txt


Report •

#2
September 30, 2010 at 15:16:11
@echo off > newfile & setLocal enableDELAYedeXpansion

for /f "tokens=* delims= " %%a in ('dir/b *.txt') do (
>> newfile type %%a
>> newfile echo.
)


=====================================
Helping others achieve escape felicity

M2


Report •

#3
September 30, 2010 at 15:19:56
Hi R2,

not quite


=====================================
Helping others achieve escape felicity

M2


Report •

Related Solutions

#4
November 22, 2010 at 14:31:20
Thankd M2 (aka Mechanix2Go)
The solution worked perfect. I have been testing it for some weeks now and it has never failed.
Thanks a ton!!
Gus

Report •

Ask Question