Batch File For Tex Manipulation

C

Carlton Noles

I have a file in a data format that cannot be read by my software.

the software will read a file in theis format:

datadata dat~ data data~ DAta~

but my file is in this format:

"datadata dat~"
"data data~"
"DAta~"

So what I need to do is strip the double quotes from the file (not a problem
in any text editor) and strip out the cr/lf also easy but a pain in the
backside. I was thinking that this may be possible with a batch file but it
has been a LONG time since I did anything with batch files an I could use to
be pointed in the right direction. ultimately it would be nifty to be to
have it perform this on all the files in a directory.

Thanx

C

Oh -- I am running xp pro and xp home (different machines obviously)
 
T

themeanies

Carlton said:
I have a file in a data format that cannot be read by my software.

the software will read a file in theis format:

datadata dat~ data data~ DAta~

but my file is in this format:

"datadata dat~"
"data data~"
"DAta~"

So what I need to do is strip the double quotes from the file (not a problem
in any text editor) and strip out the cr/lf also easy but a pain in the
backside. I was thinking that this may be possible with a batch file but it
has been a LONG time since I did anything with batch files an I could use to
be pointed in the right direction. ultimately it would be nifty to be to
have it perform this on all the files in a directory.

Thanx

C

Oh -- I am running xp pro and xp home (different machines obviously)

There is a command line program called gsar.exe. This is a global
search and replace tool which I use all the time as it will allow for
string or hex global search and replace.

Actually I think this is part of the GNU utilities for Win32

tM
 
P

Phil Robyn

Carlton said:
I have a file in a data format that cannot be read by my software.

the software will read a file in theis format:

datadata dat~ data data~ DAta~

but my file is in this format:

"datadata dat~"
"data data~"
"DAta~"

So what I need to do is strip the double quotes from the file (not a problem
in any text editor) and strip out the cr/lf also easy but a pain in the
backside. I was thinking that this may be possible with a batch file but it
has been a LONG time since I did anything with batch files an I could use to
be pointed in the right direction. ultimately it would be nifty to be to
have it perform this on all the files in a directory.

Thanx

C

Oh -- I am running xp pro and xp home (different machines obviously)

- - - - - - - - begin screen capture WinXP Pro SP2 - - - - - - - -
C:\cmd>type c:\temp\YourOldFile.txt
"datadata dat~"
"data data~"
"DAta~"

C:\cmd>demo\AllOnOneLine

C:\cmd>type c:\temp\YourNewFile.txt
datadata dat~ data data~ DAta~

C:\cmd>wyllist demo\AllOnOneLine.cmd
==========begin file C:\cmd\demo\AllOnOneLine.cmd ==========
01. @echo off
02. setlocal
03. for /f "tokens=*" %%a in (c:\temp\YourOldFile.txt) do call :combine %%a
04. echo>c:\temp\YourNewFile.txt %line:~1%
05. goto :EOF
06. :combine
07. set line=%line% %~1
08. goto :EOF
==========end file C:\cmd\demo\AllOnOneLine.cmd ==========
- - - - - - - - end screen capture WinXP Pro SP2 - - - - - - - -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top