1.

Solve : Extract first characters from each line from a txt file?

Answer»

Who KNOWS how can i extract for example 10 characters from each line from a txt file.
And for each extracted string to SAVE it in a txt file.
Google couldn't help me this time. Code: [Select]@echo off
setlocal enabledelayedexpansion
if exist target.txt del target.txt
for /f "delims==" %%L in (source.txt) do (
set string=%%L
set firstchars=!string:~0,10!
echo !firstchars! >> target.txt
)


THANKS a lot!!! That's it, it WORKS.



Discussion

No Comment Found