BatchSubstitute Output Width

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
JDV
Posts: 7
Joined: 17 Dec 2010 14:52

BatchSubstitute Output Width

#1 Post by JDV » 17 Dec 2010 15:56

First, thanks for making this tool available. It seems as though it will solve some problems I had creating a properly formed RSS XML.

The only problem is that the output is truncated after 1028 columns. I had a similar problem with the SQLCMD which creates the XML to start with, but that was remedied with a command line parameter.
The main section of the XML is one long line (usually around 4900 columns). Is there any way to increase the width that BatchSubsitute accepts?

Also, is there any way to run two sets of variables? I need to replace A with B and C with D, and would like to avoid having two scheduled tasks if possible.

Thanks,
JDV

jeb
Expert
Posts: 1055
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Re: BatchSubstitute Output Width

#2 Post by jeb » 18 Dec 2010 04:53

Hi JDV,

first have question.
Do you use the batch substitute from the library or the improved version from the forum?
Is your input file in ascii or unicode format?

Jeb

JDV
Posts: 7
Joined: 17 Dec 2010 14:52

Re: BatchSubstitute Output Width

#3 Post by JDV » 18 Dec 2010 20:22

Jeb,

I am using the version from the File Examples page.
My input file is an XML created from the SQLCMD command. I honestly don't know how to tell what the encoding is. This MSDN article states that a -u parameter (which I didn't use) results in Unicode output, but I don't know what output results without the parameter.

Thanks.

jeb
Expert
Posts: 1055
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Re: BatchSubstitute Output Width

#4 Post by jeb » 19 Dec 2010 13:07

Hi JDV,

you could try the "improved Batch Substitute" http://www.dostips.com/forum/viewtopic.php?f=3&t=1516.

The problem seems to be the find command, it have problems with long lines.
findstr accept more characters.

jeb

JDV
Posts: 7
Joined: 17 Dec 2010 14:52

Re: BatchSubstitute Output Width

#5 Post by JDV » 20 Dec 2010 10:36

That updated version did the trick.
Thanks very much!

For anyone finding this post looking for multiple instances of the .bat, I ended up creating another batch file to:
CALL BatchSubstitute.bat [stuff you want #1 to do]
CALL BatchSubstitute.bat [stuff you want #2 to do]

ghostmachine4
Posts: 319
Joined: 12 May 2006 01:13

Re: BatchSubstitute Output Width

#6 Post by ghostmachine4 » 26 Dec 2010 19:38

JDV wrote:That updated version did the trick.
Thanks very much!

For anyone finding this post looking for multiple instances of the .bat, I ended up creating another batch file to:
CALL BatchSubstitute.bat [stuff you want #1 to do]
CALL BatchSubstitute.bat [stuff you want #2 to do]

you shouldn't even use batch (cmd.exe) to parse and manipulate files. Use a tool more suitable for the job. If you can download stuff, you can use
sed for windows or gawk for windows. But Ideally, since you are working with XML, you should use an XML parser/writer (note: its ideally. If you only have simple requirements, gawk/sed will do the job)

Post Reply