SKARSATAI | 1 Feb 2005 09:06
Picon
Favicon

get german keyboard letters under xp in batch


hello 
I created a little batch for filling in some infos for handling of 
failure incidents  and than copy and past it into outlook. 
how can I insert the german keyboard funktions for using the german 
specific letters öäü ?

del order.txt
 <at> echo off

 <at> echo insert  gender:
set /p gendera=

 <at> echo insert customer:
set /p customer=

 <at> echo insert gender:
set /p genderb=

 <at> echo insert user:
set /p user=

 <at> echo incident eingeben:
set /p incident=

 <at> echo Hallo %gendera% %customer%  >> order.txt

 <at> echo bitte eröffnen Sie ein Ticket für %genderb% %user% beim SCI >> 
order.txt
 <at> echo wegen:  >> order.txt
(Continue reading)

Mic | 1 Feb 2005 10:16
Picon
Favicon

Re: get german keyboard letters under xp in batch


On Tue, 01 Feb 2005 08:06:03 -0000, SKARSATAI wrote:

> I created a little batch for filling in some infos for handling of 
> failure incidents  and than copy and past it into outlook. 
> how can I insert the german keyboard funktions for using the german 
> specific letters öäü ?

I don't deal with those characters but I think it involves changing the
code page with chcp.com

--

-- 
Regards,
Mic

To Post a message, send it to:   batchworld@...

To Unsubscribe, send a blank message to:
batchworld-unsubscribe@... 
Mic | 1 Feb 2005 12:15
Picon
Favicon

Re: Validating Text Strings & Isolating files with odd characters


On Mon, 31 Jan 2005 07:25:03 -0000, awnster wrote:

> I am currently using Windows 2000 and have a batch job which backup 
> (copy) the text files in c:\stage to c:\backup and move the files 
> from c:\stage to c:\upload. What I would like to do is add the logic 
> to the batch script to do three things:

Can you post the current batch file, and also provide some more detail
about the following.

> 1) Check the text files if it contain the letter "A" qualifier (3rd 
> character from the left in the example) in the HDR record (example: 
> HDR*A*ADDRESS*APPLICATION123456789).

R is the third character from the left, above.
* is the fouth from the left.

> 2) Check for odd characters, for this example we can use the tilde 
> character "~".

What do you mean by odd?  1,3,5,7,9?

> 3) Move files that does not have the "A" qualifier or contain the 
> tilde character "~" to c:\error\errorlog.txt.

Do these text files contain any characters that are not alphanumeric?

--

-- 
Regards,
(Continue reading)

Sam Wallace | 1 Feb 2005 12:40
Picon
Favicon

Re: Validating Text Strings & Isolating files with odd characters


Hi,

I also would like a little clarification on the following:

> 3) Move files that does not have the "A" qualifier or contain the 
tilde character "~" to c:\error\errorlog.txt.

Do you mean to append the contents of such files to errorlog.txt and 
then delete the originals? 

Thanks,

Sam

To Post a message, send it to:   batchworld@...

To Unsubscribe, send a blank message to:
batchworld-unsubscribe@... 
Sam Wallace | 1 Feb 2005 13:47
Picon
Favicon

Re: Validating Text Strings & Isolating files with odd characters


Hello,

Is there any chance that the string "HDRA" (assuming that is what you 
are looking for) will occur elsewhere in the file?

> 1) Check the text files if it contain the letter "A" qualifier (3rd 
character from the left in the example) in the HDR record (example:

HDR*A*ADDRESS*APPLICATION123456789).

If not and my other assumptions are correct, something like this 
ought to work (be careful of the possible line wrap):

 <at> echo off

for /f "delims=" %%i in ('dir c:\stage\*.txt /b') do (
						   set textfile=%%i
						   call :EVAL
						  )
GOTO END

:EVAL
find "~" "c:\stage\%textfile%" > nul
if %errorlevel%==0 GOTO TILDE_ERR
find "HDRA" "c:\stage\%textfile%" > nul
if %errorlevel%==0 move "c:\stage\%textfile%" c:\upload
GOTO END

:TILDE_ERR
(Continue reading)

awnster | 1 Feb 2005 22:41
Picon
Favicon

Re: Validating Text Strings & Isolating files with odd characters


Mic,

Thank you for your help. I'm looking forward to your next response. 
Below is my current batch job:

if not exist c:\stage\* goto END
copy /Y c:\stage\*.ord c:\backup\
move /Y c:\stage\*.ord c:\upload\
:END

Sorry for the confusions. Here are some clarifications to my previous 
message:

1) Check the text files if it contain the letter "A" qualifier (3rd 
character from the left in the example) in the HDR record. example: 
HDR*A*ADDRESS*APPLICATION123456789).

Q: R is the third character from the left, above. * is the fouth from 
the left.
A: The letter "A" qualifier is the 5th character from the left.

2) Check for odd characters, for this example we can use the tilde 
character "~".

Q: What do you mean by odd?  1,3,5,7,9?
A: Odd character such as "ñ" and square shape characters (are
these 
control charaters?). I am using the "~" instead of the square 
character since I cannot copy & paste the square character to the 
(Continue reading)

Mic | 2 Feb 2005 00:17
Picon
Favicon

Re: Validating Text Strings & Isolating files with odd characters


On Tue, 01 Feb 2005 21:41:02 -0000, awnster wrote:

> Sorry for the confusions. Here are some clarifications to my previous 
> message:
> 
> 1) Check the text files if it contain the letter "A" qualifier (3rd 
> character from the left in the example) in the HDR record. example: 
> HDR*A*ADDRESS*APPLICATION123456789).
> 
> Q: R is the third character from the left, above. * is the fouth from 
> the left.
> A: The letter "A" qualifier is the 5th character from the left.
> 
> 2) Check for odd characters, for this example we can use the tilde 
> character "~".
> 
> Q: What do you mean by odd?  1,3,5,7,9?
> A: Odd character such as "ñ" and square shape characters (are
> these 
> control charaters?). I am using the "~" instead of the square 
> character since I cannot copy & paste the square character to the 
> message.   
>  
> 3) Move files that does not have the "A" qualifier or contain the 
> tilde character "~" to c:\error\errorlog.txt.
> 
> Q: Do these text files contain any characters that are not 
> alphanumeric?
> A: Yes, it can have *, #, -, &, $, etc. 
(Continue reading)

Manfred Eichler | 2 Feb 2005 01:08
Picon

Re: get german keyboard letters under xp in batch


Hello,

this problem you cannot clar up with another codepage.

A batch is always working on the DOS-basic and do not accept this letters. Also not "ß"; a .vbs.script do this.

Therefore you can do the following:

At the end of the Batch not with copy and past into outlook, but copy this into a .txt-file and write at the end
of the batch

WScript.exe [name].vbs

[name] means the name you give this file.

The .vbs-file can show like this:
---------------------------------------
set fs = CreateObject("Scripting.FileSystemObject")
set dat1 = fs.OpenTextFile("datalt.txt", 1, vbTrue)
set dat2 = fs.OpenTextFile("datneu.txt", 8, vbTrue)
do
datx=dat1.ReadLine
datx=replace(datx, "Z", "ae", 1, -1, 1)
datx=replace(datx, "T", "oe", 1, -1, 1)
datx=replace(datx, "s", "ue", 1, -1, 1)
datx=replace(datx, "á", "ss", 1, -1, 1)
dat2.WriteLine datx
loop until dat1.AtEndOfStream = vbTrue
dat2.close
(Continue reading)

awnster | 2 Feb 2005 07:01
Picon
Favicon

Re: Validating Text Strings & Isolating files with odd characters


Hi Sam,

Thank you for help. I made some slight modifications to your script 
and it tested out great! Regarding your question, yes I would like 
to append only the name of the files that was move to the c:\error 
directory to the c:\error_log\error.txt. 

Also, I would like to learn more on batch syntax and could you do me 
one more favor and explain to me what this part of the script is 
doing?

for /f "delims=" %%i in ('dir c:\stage\*.txt /b') do (
set textfile=%%i
call :EVAL
)
GOTO END

Best Regards,

Awnster
--- In batchworld@..., "Sam Wallace" <guydep <at> h...> wrote:
> 
> Hi,
> 
> I also would like a little clarification on the following:
> 
> > 3) Move files that does not have the "A" qualifier or contain 
the 
> tilde character "~" to c:\error\errorlog.txt.
(Continue reading)

Sam Wallace | 2 Feb 2005 11:06
Picon
Favicon

Re: Validating Text Strings & Isolating files with odd characters


Hi Awnster,

To append the name of the moved files to the c:\error_log\error.txt 
file, you can pipe the output of the move command to that log file as 
Mic did in his example:

move "c:\stage\%~1" c:\error >>c:\error\errorlog.txt

The FOR command is one of the most useful to batch writing. It allows 
you to go through a list of items and do the same task for each item 
on the list. The way I used it, the batch file would look at the list 
generated by the DIR command, then take each file name and send it to 
the EVAL section of the batch as the TEXTFILE variable. After it 
processed the list, it would go to the END section of the batch 
where, in this case, nothing happens. The part that reads "delims=" 
is used to keep spaces from breaking the file names into separate 
variables if they have spaces in them. Also, if you try running a FOR 
statement directly from the command line, you should be aware that 
you should use only one % while doing so from within a batch file 
calls for two.

Thanks,

Sam
******************

> Hi Sam,

> Thank you for help. I made some slight modifications to your script 
(Continue reading)


Gmane