Convert a string to a number with a batch fil
nidhal
-
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.
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:
- Batch convert string to number
- Fichier batch - Guide
- Qwerty to azerty - Guide
- Bat to exe converter - Télécharger - Édition & Programmation
- Video to video - Télécharger - Conversion & Codecs
- Majuscule to minuscule - Guide
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.