I am using the following DOS command script to append date (which is
part of the file name) to every record in the file.
It works fine just that I am having a problem as described below.
@[EMAIL PROTECTED]
off
setlocal enabledelayedexpansion
del "xyz.txt" 2>nul
for %%i in (abc*.txt) do set yfn=%%~ni&set yfn=!yfn:~-6!&for /f
"usebackq delims=" %%j in ("%%i") do echo "!yfn!"^|%%j>>"xyz.txt"
FYI - The FOR loop above is a long single line ending with .....
>>"xyz.txt"
The problem I am having is more like data related. It is truncating
the records for some special characters. One such char I know of is
"!" exclamation sign. If it is part of any record in the file the
record truncates here upto a certain point when it finds another
special char - Here is an example record.
Input record - for an input file name abc_080606.txt
8271909100343836|9999999999999|****TAL,ROBERTO|4424 FERRARI DR|DUPATE
ADDRESS!|SEBRING|FL|33872-2883|4424 FERRARI DR| |SEBRING|FL|33872-2883|
06|$= $~ .D ;O ?? AA BO CF CQ D0 D1 D2 D3 JW K: K> M# V. XP ZH }{ }}|
33872288300042008|20051102|20080606|00010101|20080606|A0I||A0I|AT| |
| |DV
and the output record looks like this - with the date added in front
of the record
If you notice it truncates at ! and then starts again after the ':'
sign.
"080606"|8271909100343836|9999999999999|****TAL,ROBERTO|4424 FERRARI DR|
DUPATE ADDRESS K> M# V. XP ZH }{ }}|33872288300042008|20051102|
20080606|00010101|20080606|A0I||A0I|AT| | | |DV
Any help - why the records are losing part of their content will be
really appreciated?