rows to 1column?

  • Thread starter Thread starter Henry
  • Start date Start date
H

Henry

Ladies and Gentlemen
Can you possibly assist?
I have a file Current_file.txt. I need to use the rows in
this file as ONE single string. Making use of .bat how can
I convert the rows to colums?

Example:
more Current_file.txt
one
two
three

more New_file.txt
one two three
 
Henry said:
Ladies and Gentlemen
Can you possibly assist?
I have a file Current_file.txt. I need to use the rows in
this file as ONE single string. Making use of .bat how can
I convert the rows to colums?

Example:
more Current_file.txt
one
two
three

more New_file.txt
one two three

@echo off
setlocal

echo Version one
for /F "tokens=*" %%A in (current_file.txt) do (set /P =%%A <nul)
echo ^<-

echo Version two
if defined line set line=
for /F "tokens=*" %%A in (current_file.txt) do (call set line=%%line%% %%A)
echo %line:~1%^<-

HTH
 
Back
Top