1.

Solve : check for numerical values in a .txt file?

Answer»

I have an MS SQL query that outputs a .txt file containing a 6 character numerical string in the first line, STARTING at pos 1.
If the query has no result the output will be whitespaces in the 1st line in the 7 first POSITIONS in the same .txt file (and for some reason a 2nd line with lots of whitespaces).

I've run into problems since the string in pos 1-6 in 1st line of the .txt file is used as input string to another application that goes bananas if I put null/whitespace into it.

How can I check if the .txt file actually has 6 numerical CHARACTERS in the first line at pos 1-6?

I'd appreciate any help... Code: [Select]set /p "var="<"file.txt"
if "%var%"==" " echo seven spaces were found.Thanks foxidrive...it's ALWAYS so easy once you see the code...

Have a great DAY



Discussion

No Comment Found