Link to home
Start Free TrialLog in
Avatar of Xbradders
Xbradders

asked on

Excel - Export to CSV is returning extra commas at the end lines

I have an Excel doc that needs to be exported to CSV text file, to be imported into a database.  When I export to CSV nearly every line has extra commas at the end, which need to be removed.  I believe it is adding these to match the column number of the largest row in my Excel doc.  I don't have a fixed number of column headers though, so I don't want these extra columns.  e.g., so rows my have data in 4 columns, where some may have 5, 6, 7, or 8 columns with data.

Any idea how to export without these?  I'm trying to avoid having to manually remove them from the exported CSV.  Thanks -
Avatar of nutsch
nutsch
Flag of United States of America image

How's your database going to deal with those missing columns?
Why do you have to remove the commas in the first place?

Thomas
SOLUTION
Avatar of Paul Sauvé
Paul Sauvé
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Xbradders
Xbradders

ASKER

Forget about where the data is going.  Let's just say my destination system knows what to do with the CVS file.  (it's actually just reading in lines of the CSV, with the first column acting as the key and subsequent columns as values).  So the CSV could look like:

furniture, couches, chairs, tables, desks, cabinets
sports, hockey, baseball, football, soccer, golf, track, swimming, rowing, skiing, snowboarding
fruits, apples, oranges, grapes
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial