Replace String with ASCII Character

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Replace String with ASCII Character

Post by kpassaur » Fri Nov 07, 2008 6:41 pm

What I am trying to do is replace a line in a text file that has

********** PAGE BREAK **********

with ASCII 12

Ideally, since these are long files I would like to use StringReplace and the ASCII Character. I have tried the method here

VBSTART
VBEND
ReadFile>C:\test\test1-1.txt,sourcefile
VBEval>Replace("%sourcefile%","++",chr(12)),newstring
MessageModal>%newstring%

But I believe that sinces it is more than one line I am getting an error.

Using StringReplace I can use a %CRLF% for Cariage Return Line Feed can %FF% be used for NP Form Feed New Page?

Or is there a way to assign an ascii character to a variable, such as

Let>formfeed=chr(12) or
Let>formfeed=ASCII (12) - yes I just made that one up

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Fri Nov 07, 2008 7:31 pm

Assign ascii char to variable

Code: Select all

VBstart
VBend
VBEval>chr(82),mychar
MDL>mychar

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts