Re: Problem saving excel as CVS when last field is blank for all values

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Saved from a previous post:

This might describe the problem of too many commas in CSV files:

http://support.microsoft.com/default.aspx?scid=77295
Column Delimiters Missing in Spreadsheet Saved as Text

(It actually describes missing delimiter, but if some are "missing", maybe the
ones appearing are "extra".)

(But a lot of programs (excel included) don't care about those extra columns.
Maybe you don't have to care, either???)

Maybe you could write your own exporting program that would behave exactly the
way you want:

Here are three sites that you could steal some code from:

Earl Kiosterud's Text Write program:
www.smokeylake.com/excel
(or directly: http://www.smokeylake.com/excel/text_write_program.htm)

Chip Pearson's:
http://www.cpearson.com/excel/imptext.htm

J.E. McGimpsey's:
http://www.mcgimpsey.com/excel/textfiles.html

(or maybe you could build your own formula and copy|paste into Notepad.)

Napoleon wrote:

Hello,

I am attempting to save an excel file as a CVS file in order to bulk
insert it into SQL Server (I know DTS can import Excel files directly,
but I need to use Bulk Insert).

The problem is that the all of the values in the final field is blank
(I did not create the file). For example:
Field1 Field2 Field3
1 2
1 2
1 2

The problem is when I save it as a CVS file only the first 16 rows have
a comma between Field2 and Field3. The rest of the rows only has a
comma after Field1. For example:
Field1,Field2,Field3
1,2,
1,2,
1,2
1,2

Does anyone know if there is a way to fix this?

Thanks

--
Napoleon
------------------------------------------------------------------------
Napoleon's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=37002
View this thread: http://www.excelforum.com/showthread.php?threadid=567279

--

Dave Peterson
.



Relevant Pages

  • Re: CSV dropping last comma for all lines after line 15
    ... Column Delimiters Missing in Spreadsheet Saved as Text ... Then try saving the file as a CSV file. ... noticed that Excel is dropping the last comma on the lines beyond data line ...
    (microsoft.public.excel.setup)
  • Re: time stamp, file length
    ... How do i stretch both files to make it same lenghth assigning 0 or blank to data pts which are missing. ... you showed us has space, not comma, as the delimiter. ... Can you help me to read this .csv file ?properly so i can convert the first column into a string using datenum. ...
    (comp.soft-sys.matlab)
  • Re: Better than bells
    ... jflaylor, you couldn't be a sleazier weasel, you have reached true ... A misspelled word? ... No, it's not missing a comma, it's missing TWO commas. ...
    (rec.bicycles.tech)
  • Re: Help with VLOOKUP or other matching function
    ... The comma was what I was missing. ... I have a worksheet that lists ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Save As CSV problem
    ... This might describe the problem of too many commas in CSV files: ... Column Delimiters Missing in Spreadsheet Saved as Text ... Maybe you don't have to care, ...
    (microsoft.public.excel.misc)