+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    08-03-2009
    Location
    San Francisco
    MS-Off Ver
    Excel 1997
    Posts
    3

    Question Column count mismatch after export

    Hi:

    I have a table with 5,000+ rows that I'm exporting to a CSV file and then importing into a library catalog. Until today, it imported without any problems.

    Today, I added HTML code to the columns that contain hyperlinks so that they will open when they are clicked. The links work.

    The problem is only about 10% of the rows are now imported. The other records say "Column Count Mismatch." From comparing the rows in Notepad, I can see that the rows that were not imported have a different column count, as delineated by commas, than the imported columns.

    A couple of things are worth noting:

    1) In the export file, the column count varies from row to row. (A full row contains 13 columns. Some columns have 8 or 13 or 12... which of course is the problem.)

    2) The rows that import are not necessarily consecutive. For example, it may import rows 10-13, not import 14-19 but import 20-22...

    When I look at the file as it was prior to putting in my html code, each row has 13 columns. The only difference seems to be the number of commas but there are no commas in the code that I inserted. Also, literally thousands of the records that were unaltered by the html code insertion now have the wrong number of columns.

    Any help would be greatly appreciated.

    Ethan

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: Column count mismatch after export

    Excels output of csv data can cause problems as it drops commas for empty cells rather than outputting consitent number of commas per record.

    You can work around this by either,

    adding a final column that contains a value
    or
    adding a final row that contains values for each field

    The problem with both options is the next program that imports the csv has to know to ignore the helper row/column.

    If that doesn't work can you post small example file to demonstrate the problem.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    08-03-2009
    Location
    San Francisco
    MS-Off Ver
    Excel 1997
    Posts
    3

    Re: Column count mismatch after export

    Andy,

    Ultimately, I put a row with every column filled in at the bottom of the spreadsheet and a column with every row filled in after the final column. It worked.

    Thank you very much. The problem had me completely baffled until I read your message.

    Best regards,
    Ethan

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0