将文本文件转换为csv [英] convert text file into csv

查看:122
本文介绍了将文本文件转换为csv的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先我需要转换成csv然后插入到sql server



i有大文本文件(差不多110000行)



像这样分开



名称|地址|联系no |性别等



i希望转换成csv



在excel中打开转换成csv它给我此错误



此消息可能由于以下原因之一而出现:

该文件包含超过1,048,576行或16,384列。修复此问题,在文本编辑器(如Microsoft Word)中打开源文件。将源文件保存为符合此行和列限制的几个较小文件,然后在Microsoft Excel中打开较小的文件。如果源数据不能在文本编辑器中打开,尝试将数据导入Microsoft Access,然后将数据的子集从Access导出到Excel。

您尝试将选项卡描述的数据粘贴到的区域也是如此要解决此问题,请在工作表中选择一个足够大的区域以容纳每个分隔项目。

注意

Excel不能超过1,048,576行和16,384列的限制。

默认情况下,E xcel将三个工作表放在工作簿文件中。每个工作表可以包含1,048,576行和16,384列数据,如果您的计算机有足够的内存来支持其他数据,则工作簿可以包含三个以上的工作表。

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

推荐答案

1)您的文件已经是CSV格式。



2)Excel有行限制。



3)如果要插入SQL服务器,则直接在没有Excel的情况下插入使用散装嵌件的负载逗号分隔的文件 - 进入 - SQL服务器进口-CSV文件-到-SQL服务器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 / [ ^ ]
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/[^]


签出文件管理器。它是一个免费图书馆,工作得很好。

http://filehelpers.sourceforge.net/ [ ^ ]



祝你好运!
Check out filehelpers. It is a free library and works great.
http://filehelpers.sourceforge.net/[^]

Good luck!


这篇关于将文本文件转换为csv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆