Hi,
I lack the utter fundamentals on how to craft an awk script.
I have hundreds of text files that were mangled by .doc format so all the lines are broken up so I need to join all of the lines of text into a single line. Normally I use vim command "ggVGJ" to join all lines but with so many files, I need a batch process.
What would be ideal is:
awk -f ~/scripts/join_all_lines.awk *.txt
But I having trouble crafting "join_all_lines.awk".
I have found:
awk -vORS=' ' 1 filename
but I don't know how to script that into "join_all_lines.awk" and also it doesn't edit the file in place, it just displays the output.
I also found:
xargs echo <filename
it gives the same result. I don't know how to get them to edit a bunch of text files in place.
Can anyone help me out? Plz?