+ Reply to Thread
Results 1 to 8 of 8

Excel 2007 : importing csv bug?

  1. #1
    Registered User
    Join Date
    11-29-2011
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    3

    importing csv bug?

    I have an issue importing a csv file. overall it works fine, separating the fields by the correct delimiter and placing them in the correct columns, unless there is an "enter" forming another line in between delimiters. I have multiple lines inside one field in the csv file and Excel is reacting by placing them in a new row starting in column A and each new line gets placed on the next row down in column A, even though "enter" or a new line, is not set as the delimiter. I have searched around and haven't seen anything about this problem and I can't find any settings to have excel ignore enter as it is importing and just keep everything within 1 field in the same cell.

    I will mention that libre office calc imports the same csv file flawlessly so I have to think excel should be capable of doing it.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: importing csv bug?

    It would be good if you can attach a sample workbook so that we can help you out easily.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,449

    Re: importing csv bug?

    I just did a simple test and new lines will be accepted in a field if enclosed in quotes.

    As suggested post example csv file.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    11-29-2011
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: importing csv bug?

    Here is a test file, excel test, saved in standard excel format with a cell with multiple lines in it (used alt+enter to make multiple lines in the cell). Save it as a csv text file(i used comma separated, it also has tab separated). then try importing that file, it will place the extra lines in the multiple line cell into their own rows, not even staying in the same column, they will go to the first column.

    If you don't want to do it all, the excel test 2 file is the result of its import.

    I just tried with quotes and they didn't change anything and besides that, even if it did work, that really hurts csv compatability. Most other applications won't think that the quotes are there to say there are multiple lines, most applications will display the quotes as they are in the text as the quotes are not defined as anything other than a quote character. If you used quotes and got it to work, I don't think you were doing the same thing.

    and again, as i said in the first post, libreoffice calc takes the csv file excel saved and imports it keeping everything in the correct cells.
    Attached Files Attached Files
    Last edited by fordry; 11-30-2011 at 06:36 PM.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: importing csv bug?

    here's what i get,looks ok to me
    Attached Images Attached Images
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Registered User
    Join Date
    11-29-2011
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: importing csv bug?

    that didn't look like excel 2007.......

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: importing csv bug?

    and? it doesn't make any difference. but if you insist
    Attached Images Attached Images

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,449

    Re: importing csv bug?

    You need to post the original csv file not a workbook where you have already loaded it.

    different apps behave differently when handling csv files.

  9. #9
    Registered User
    Join Date
    03-06-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    0

    Re: Excel 2007 : importing csv bug?

    Yeah, excels CSV import functionality has several flaws.

    * Open works differently from linking, I believe
    but most importantly:
    * excel does not respect the text quote start/end w r t crln:
    Excel will always interpret CRLN as a new datarow, regardless of if it is within a textfield or really at the end of the datarow.
    SO: A CSV with a multiline field, quoted correctly, will not be imported correctly by excel.
    Excel will break to a new datarow in the middle of the field and continue reading off the previous field data in the new row, breaking the import completely.

    However, if the multiline fields in the CSV use linefeed to break between lines, excel parses it correctly.

    It's a really annoying bug.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1