losing line breaks

  • Thread starter Thread starter linuxnooby
  • Start date Start date
L

linuxnooby

Hi

I am importing a csv (comma delimited) file into excel but I am losing
line breaks for example, if import the following csv file created in
notepad


column one,"column two paragraph one

column two paragraph two",column three



What appears in excel is
column two paragraph one column two paragraph two

I was under the impression that using quotation marks around the field
should preserve the line breaks. Any suggestions welcome

cheers David
 
I think excel sees those line breaks and says "Hey, time to start a new row!"

I'd try to change the embedded linebreaks to a unique character--one that excel
will just see as data. Then import the file, then change that unique character
back to a linefeed.

After you import the data, you can use:
edit|Replace
what: (youruniquecharacter)
with: ctrl-j
replace all

The difficult part will be fixing that text file.
 
If you have a file named test.csv that contains everything between the =
lines

============================
column one,"column two paragraph one

column two paragraph two",column three
============================

Then when I open the file from Excel 2000 I get the following spreadsheet:
A1 contains: column one
B1 contains: column two paragraph one []
[]
column two paragraph two
C1 contains: column three

where the [] represents a character rendered as a box, and followed by a
line break of the type that you get when you use Alt-Enter inside a cell.

That resuls seems to be pretty much what I should get. Is that what you are
tryiung to get?

John
 
Hi guys thanks for the replies.

I was importing the csv file incorrectly.
I was using the drop down menu Data> Import External data (this does
not seem work correctly).

But when I use the File Open it works fine.

PS the search and replace method only seems to work on blocks of text
of a limited length otherwise you get an error "formula too long"

cheers Dave
 
Back
Top