import text file containing line breaks into excel

Posted by Maximilian Tyrtania on Stack Overflow See other posts from Stack Overflow or by Maximilian Tyrtania
Published on 2008-12-04T12:17:34Z Indexed on 2010/06/03 10:04 UTC
Read the original article Hit count: 223

Filed under:
|

I have a plain text file looking like this:

"some
text
containing
line
breaks"

I'm trying to talk excel 2004 (Mac, v.11.5) into opening this file correctly. I'd expect to see only one cell (A1) containing all of the above (without the quotes)...

But alas, I can't make it happen, because Excel seems to insist on using the CR's as row delimiters, even if I set the text qualifier to double quote. I was sort of hoping that Excel would understand that those line breaks are part of the value - they are embedded in double quotes which should qualify them as part of the value. So my Excel sheet has 5 rows, which is not what I want.

I also tried this Applescript to no avail: tell application "Microsoft Excel" activate open text file filename ¬ "Users:maximiliantyrtania:Desktop:linebreaks" data type delimited ¬ text qualifier text qualifier double quote ¬ field info {{1, text format}} ¬ origin Macintosh with tab end tell

If I could tell Excel to use a row delimiter other than CR (or LF), well, I'd be a happy camper, but excel seems to allow the change of the field delimiter only, not the row delimiter.

Any pointers?

Thanks,

Max Excel's open

© Stack Overflow or respective owner

Related posts about excel

Related posts about vba