How would I add carage returns to a text file file in UNIX Part 2
Posted on 2006-03-22
I got this example yesterday which works on 2 different files. Does anyone know how to manipulate just one file?
I need the input file and output file to be the same.
This will create a blank file. But I need to open test.txt and insert the carage returns on test.txt. The code below make a duplicate of test.txt to out.txt.
while ( <IN> )
chomp; # remove line terminator
print(OUT "$_\r\n"); # add window style line terminator