Hi,
How do I combine multiple lines onto a single line in a text file using Winbatch?
Thanks,
Khoa
You will probably need to expand on your question a bit as it is light on details...but, perhaps the following will be helpful...
You can remove the @CRLF (assuming it is a Windows text file) using StrReplace(lines,@CRLF,"")
You can concatenate using StrCat() or ":" to join the lines.
Jim
Thanks for your respond Jim!
I am still confused how to do it. Say I have a Windows text file with 4 lines in it. I am looking for a way to read the content of a text file (as a whole), and then (combine all 4 lines into 1 line) rewrite them onto an other text file.
Thanks,
khoa
Something like:
txt = FileGet(text_file)
txt = StrReplace(txt,@CRLF," ")
FilePut(new_text_file,txt)
Jim
Note...I put a space at the end to separate the lines....If you don't want a space just adjust the StrReplace() function as needed.
Jim
Perfect! It is working!
Thanks so much Jim!
Khoa