I received a bunch of text files from a Linux system. They have LF but no CR. When reading the file Excel VBA reads the entire file as one line.
I write a little routine that makes the change. All the file names are in the array of strings.
&&&&&&&&&&
For file_number = 1 To FILE_NAME_COUNT
input_file_name = DIR_NAME + file_names(file_number)
Open input_file_name For Input As #2
Line Input #2 , text
read_length = Len(text)
text = Replace(text, Chr(10), vbCrLf)
Close #2
Open input_file_name For Output As #2
Print #2 , text
Close #2
Next file_number
&&&&&&&&&&
Problem: The Print line prints only up to the first CR. What can I use to write the entire string?
I write a little routine that makes the change. All the file names are in the array of strings.
&&&&&&&&&&
For file_number = 1 To FILE_NAME_COUNT
input_file_name = DIR_NAME + file_names(file_number)
Open input_file_name For Input As #2
Line Input #2 , text
read_length = Len(text)
text = Replace(text, Chr(10), vbCrLf)
Close #2
Open input_file_name For Output As #2
Print #2 , text
Close #2
Next file_number
&&&&&&&&&&
Problem: The Print line prints only up to the first CR. What can I use to write the entire string?