Read line from two text files and make output
Posted: 22 Apr 2019 05:49
Hi,
What I want is described in following pseudo code:
How to implement above function in batch file?
Thanks
What I want is described in following pseudo code:
Code: Select all
file1=openfile in1.txt
file2=openfile in2.txt
file_out=openfile out.txt
while not file1.EOF and not file2.EOF
{ // in each loop, read next line from file1 and file2
line_in_file1=file1.ReadLine
line_in_file2=file2.ReadLine
// two lines are not same
if line_in_file1 <> line_in_file2
{
// line_in_file1 and line_in_file2 are made into
// one line and append the line to end of out.txt
file_out.append_line( line_in_file1 & line_in_file2 )
}
}
close file1
close file2
close file_out
Thanks