Search code examples
batch-filedos

How to read space from one text file and put into another file line by line


In text file having the some space, I need to these space with line in next text file. for e.g in a.txt:

                   c:/abc/text
                   c:/bec/text

I need the same into another file, But when I am doing in batch script, space have removed and shows like:

c:/abc/text
c:/bec/text

Solution

  • Here you go

    for /f "tokens=* delims=" %%a in (C:\text.txt) do echo %%a>>C:\new.txt