
The Text Import Wizard displays "line1 initially. To test idempotence, put the formula ="line1" &ĬHAR(10) & "line2" into A1, save as a tab-separated text file, then import the file into a new worksheet. If someone tests a later version of Excel, and the Text Import Wizard is idempotent, I might consider developing the appropriate replacement procedure, if no one else does. So again, it does not seem worth the effort. It would have to be carefully customized for other errant CSV file. Sigh.)īut the implementation would need to be specific to the form and/or content of the example CSV file.

(The Text Import Wizard still misinterprets it. However, it is not worth the effort because the Excel Text Import Wizard violates the principle of idempotence: it does not interpret cells of that form correctly, even though that is how cells with LFs are output when Excel creates a tab-separatedĪlternatively, it would be possible (but more difficult) to rejoin lines in a copy of the CSV file, adding double-quotes around the joined text.Įxcel does interpret that form as intended when we open the CSV file directly using Excel. Actually, it is not so simple but it is doable. It would be better if "foobar NEW.txt" retained the LF characters, and the VBA procedure "simply" added double-quotes around the tab-separated text, if necessary.


If the original path name is c:\.\foobar.txt, the VBA procedureĬreates a modified copy with the new path name c:\.\foobar NEW.txt. Well, it is not difficult to write a VBA procedure that replaces all LF characters with spaces.ĭownload "fileReplaceLF.bas" ( click here) and import it into an instance of Excel. I am afraid there is not very much we can do. JP Ronse wrote: The line feed is already in your text file.
