Convert a string to a number with a batch fil

nidhal -  
 nidhal -
Hi,
I'm reading string from a CSV file and I want to convert this string to an Integer (all the strings in the file are numbers' format). I want to write this using batch file.

this a sample of my code :
for /F "tokens=1,2 delims=," %%A in (File1.csv) do (
for /F "tokens=1,2 delims=," %%X in (File2.csv) do (
if %%A == %%X (
set /a R=%%B + %%Y
echo %%A,%%B,%%Y,%R%>>Results.csv )
)
)
My issue here is that R is all the time empty (I guess I can't add 2 strings).

I need help.

Thanks a lot.
A voir également:

1 réponse

Pacorabanix Messages postés 3248 Date d'inscription   Statut Membre Dernière intervention   663
 
hi. this is a French speaking forum.

for English, please go to http://en.kioskea.net/forum/
0
nidhal
 
sorry thanks.
0
nidhal
 
Salut j'ai reçu aucune réponse dans le forum anglais donc je repose ma question en français :

je suis entrain d'écrire un script BATCH qui permet de lire d'un fichier format CSV un ensemble de chaîne de caractères numérique de type ("123456") pour effectuer des opérations arithmétiques après. Mon problème c'est que j'ai pas trouve un moyen de convertir une chaîne de caractère en entier (String to Integer)en langage BATCH pour pouvoir faire les opérations.

quelqu'un a une idée, j'ai besoin d'aide.

Merci.
0