Click here to Skip to main content
15,867,834 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
first i need to convert into csv then insert into sql server

i have huge text file ( almost 1100000 rows )

seprated by like this

name |address |contact no| gender etc

i want to convert into csv

as open in excel to convert into csv its giving me this error

" This message can appear due to one of the following:
The file contains more than 1,048,576 rows or 16,384 columns. To fix this problem, open the source file in a text editor such as Microsoft Word. Save the source file as several smaller files that conform to this row and column limit, and then open the smaller files in Microsoft Excel. If the source data cannot be opened in a text editor, try importing the data into Microsoft Access, and then exporting subsets of the data from Access to Excel.
The area that you are trying to paste the tab-delineated data into is too small. To fix this problem, select an area in the worksheet large enough to accommodate every delimited item.
Notes
Excel cannot exceed the limit of 1,048,576 rows and 16,384 columns.
By default, Excel places three worksheets in a workbook file. Each worksheet can contain 1,048,576 rows and 16,384 columns of data, and workbooks can contain more than three worksheets if your computer has enough memory to support the additional data.
"
Posted

1) Your file is already in a CSV format.

2) Excel has a row limit.

3) If you want to insert into SQL server then do so directly without Excel http://blog.sqlauthority.com/2008/02/06/sql-server-import-csv-file-into-sql-server-using-bulk-insert-load-comma-delimited-file-into-sql-server/[^]
 
Share this answer
 
Comments
Sascha Lefèvre 3-Apr-15 3:20am    
My 5.
Mehdi Gholam 3-Apr-15 4:26am    
Thanks Sascha!
Check out filehelpers. It is a free library and works great.
http://filehelpers.sourceforge.net/[^]

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900