Trying to use SAS software to write .txc file

Tool for Search and Replace across multiple files.
Post Reply
gkeeler
Posts: 2
Joined: Tue Nov 11, 2014 7:22 pm

Trying to use SAS software to write .txc file

Post by gkeeler »

Hi DV. I'm a green TextCrawler user and not sure what I'm doing. I have tons of ID changes to make across some huge DNA files. I'm using SAS to write the .txc file text.

I'm reading *.mldose files (plain text) from one folder, searching for a particular ID at the start of a line (reg exp), replacing that ID with a new ID, and writing the file to a new folder.

I started by typing an example with just one ID change in the batch editor and produced the .txc file below.


<?xml version="1.0" encoding="utf-16"?>
<TextCrawlerBatch Version="3.0">
<command name="SetFilter">
<flags>*.mldose</flags>
</command>
<command name="SetOutputFolder">
<flags>D:\GPK\SAS\DATASETS\dbGaP\GSMS_Submission\ped_map_newID</flags>
</command>
<command name="SetInput">
<flags>D:\GPK\SAS\DATASETS\dbGaP\GSMS_Submission\ped_map</flags>
</command>
<command name="SubFoldersOff" />
<command name="FindRep">
<find xml:space="preserve">^A00201</find>
<replace xml:space="preserve">10001</replace>
<flags></flags>
</command>
</TextCrawlerBatch>

When I submit the DOS command

"C:\Program Files (x86)\TextCrawler Pro\TextCrawler.exe" /b
"D:\GPK\SAS\DATASETS\dbGaP\DemographicsNewID.txc" /r /c

TextCrawler opens up and runs the batch file but doesn't produce the new file in the output folder.
Any ideas on what I'm missing?

Thanks for the great program. Gordon
User avatar
DigitalVolcano
Site Admin
Posts: 1729
Joined: Thu Jun 09, 2011 10:04 am

Re: Trying to use SAS software to write .txc file

Post by DigitalVolcano »

Is it finding anything when it runs the batch file?

Couple of ideas -
Is the batch file saved in Unicode 16 (UCS-2)? It doesn't seem to like UTF-8 or ANSI.

<find xml:space="preserve">^A00201</find>
-I assume this is meant to be a regular expression? (if not you need the non regex flag).
gkeeler
Posts: 2
Joined: Tue Nov 11, 2014 7:22 pm

Re: Trying to use SAS software to write .txc file

Post by gkeeler »

The text files to be scanned are encoded in ANSI.

I deleted the reg exp requirement (^) and it works fine now scanning the ANSI files.
I'm sure the find process (with all the required ID changes) would be faster if I convert the file to Unicode and use reg exp, but I'm not sure how to do that yet.

Thanks so much for the quick response. Gordon
Post Reply