From: Alex Blekhman on
"Warren Phillips" wrote:
> Thank you very much


You're welcome. :)
From: Warren Phillips on
Alex:

I am missing something here:

I am pasting the code at the end of this REPLY into notepad...then saving
the file as convert.cmd

I am putting this file (convert.cmd) into the following folder (C:\logs)
along with all the log files I want to convert.....Then I am going out to
DOS.....then into C:\logs....and then typing ""convert.cmd". I am getting a
message that states "


C:\Logs>convert.cmd
Converts all Unicode text files in given directory to
'ANSI.' is not recognized as an internal or external command,
operable program or batch file.

convert directory

directory Specifies the directory to scan

C:\Logs>dir
Volume in drive C has no label.
Volume Serial Number is B0F4-D441

Directory of C:\Logs

04/10/2007 09:26 PM <DIR> .
04/10/2007 09:26 PM <DIR> ..
04/10/2007 08:04 PM 87,882 BEX01832.txt
04/10/2007 08:05 PM 6,702 BEX_ORLEANSFILESERV_01798.txt
04/10/2007 07:58 PM 438 convert.cmd
3 File(s) 95,022 bytes
2 Dir(s) 53,279,723,520 bytes free

C:\Logs>

***********************************************
Code I am pasting into "convert.cmd"

@echo off

if "%1"=="" goto :usage
if "%1"=="/?" goto :usage
if "%1"=="-?" goto :usage

pushd %1
for %%f in (*.txt) do call :convert "%%f"
popd
goto :eof

:convert
echo Converting %1 ...
type %1 > "%~n1.tmp"
del %1
ren "%~n1.tmp" %1
goto :eof

:usage
echo Converts all Unicode text files in given directory to
ANSI.
echo.
echo %~n0 directory
echo.
echo directory Specifies the directory to scan

Any ideas on what I might be missing

Thank you very much

Warren

"Alex Blekhman" wrote:

> "Warren Phillips" wrote:
> > Thank you very much
>
>
> You're welcome. :)
>
From: Alex Blekhman on
"Warren Phillips" wrote:
> Alex:
>
> I am missing something here:
>
> I am pasting the code at the end of this REPLY into
> notepad...then saving
> the file as convert.cmd
>
> I am putting this file (convert.cmd) into the following
> folder (C:\logs)
> along with all the log files I want to convert.....Then I
> am going out to
> DOS.....then into C:\logs....and then typing
> ""convert.cmd". I am getting a
> message that states "
>
>
> C:\Logs>convert.cmd
> Converts all Unicode text files in given directory to
> 'ANSI.' is not recognized as an internal or external
> command,
> operable program or batch file.
>
> convert directory
>
> directory Specifies the directory to scan

Oh, I see. The problem is that word "ANSI" within the script
wrapped by my newsreader and ended up on new line. In
section ":usage" each line must start with command "echo".
Just put "ANSI" in the end of previous line.

The script should recieve target folder as parameter:

convert.cmd C:\Log

It doesn't matter where script itself is located. When
launched without any parameters it prints usage info.

If you want to process current directory, then just use "."
as parameter:

convert.cmd .

I made input folder as parameter to script in order to gain
some flexibility and avoid copying it each time into target
folder. As an added bonus you can drag and drop desired
folder right onto the script without going to command
prompt.

Alex


From: Warren Phillips on
Alex:

That was it....worked perfectly.

I can't even begin to tell you how much time this is going to save us every
month....hours upon hours

It never ceases to amaze me that there are people out there willing to help
out with guestions like this.

Thank you so much for taking your time to help out

Warren Phillips

"Alex Blekhman" wrote:

> "Warren Phillips" wrote:
> > Alex:
> >
> > I am missing something here:
> >
> > I am pasting the code at the end of this REPLY into
> > notepad...then saving
> > the file as convert.cmd
> >
> > I am putting this file (convert.cmd) into the following
> > folder (C:\logs)
> > along with all the log files I want to convert.....Then I
> > am going out to
> > DOS.....then into C:\logs....and then typing
> > ""convert.cmd". I am getting a
> > message that states "
> >
> >
> > C:\Logs>convert.cmd
> > Converts all Unicode text files in given directory to
> > 'ANSI.' is not recognized as an internal or external
> > command,
> > operable program or batch file.
> >
> > convert directory
> >
> > directory Specifies the directory to scan
>
> Oh, I see. The problem is that word "ANSI" within the script
> wrapped by my newsreader and ended up on new line. In
> section ":usage" each line must start with command "echo".
> Just put "ANSI" in the end of previous line.
>
> The script should recieve target folder as parameter:
>
> convert.cmd C:\Log
>
> It doesn't matter where script itself is located. When
> launched without any parameters it prints usage info.
>
> If you want to process current directory, then just use "."
> as parameter:
>
> convert.cmd .
>
> I made input folder as parameter to script in order to gain
> some flexibility and avoid copying it each time into target
> folder. As an added bonus you can drag and drop desired
> folder right onto the script without going to command
> prompt.
>
> Alex
>
>
>
From: Alex Blekhman on
"Warren Phillips" wrote:
> It never ceases to amaze me that there are people out
> there willing to help
> out with guestions like this.

It's just pleasing to flex muscles occasionally. :)

> Thank you so much for taking your time to help out

You're welcome.