Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem saving excel as CVS when last field is blank for all values


Hello,

I am attempting to save an excel file as a CVS file in order to bul
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 blan
(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 hav
a comma between Field2 and Field3. The rest of the rows only has
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?

Thank

--
Napoleo
-----------------------------------------------------------------------
Napoleon's Profile: http://www.excelforum.com/member.php...fo&userid=3700
View this thread: http://www.excelforum.com/showthread.php?threadid=56727

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Problem saving excel as CVS when last field is blank for all values

That's way Excel exports data, in blocks of 16 rows. Can't find MS KB
article at the moment, but this is by design.
Either make sure there is a least 1 value (even a "" or 0) in each 16 row
block, or save your own data.

NickHK

"Napoleon" wrote in
message ...

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...o&userid=37002
View this thread: http://www.excelforum.com/showthread...hreadid=567279



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Problem saving excel as CVS when last field is blank for all values

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...o&userid=37002
View this thread: http://www.excelforum.com/showthread...hreadid=567279


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Values in Excel when using RTD nhench Excel Worksheet Functions 4 April 9th 07 06:44 PM
How do I prevent saving an excel file if cells are blank? Leighann Excel Worksheet Functions 1 November 4th 06 07:40 PM
Linked date field in worksheet defaults a blank field as 1/0/1900 AmnNkD Excel Worksheet Functions 2 September 12th 06 05:42 PM
In Excel, how to make a field required so it's not left blank? linplex Excel Programming 1 June 5th 06 03:10 PM
Q: assign field background color dynamically according to field values Stephan Schnitzler Excel Programming 5 January 7th 05 07:35 AM


All times are GMT +1. The time now is 06:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"