包含“制表符分隔"的文本(.txt)文件 [英] text(.txt) file that contain 'tab delimited'

查看:1888
本文介绍了包含“制表符分隔"的文本(.txt)文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好团队,

我有一个包含制表符分隔"数据的文本(.txt)文件,我想读取该文件并将值保存在数据表中.
在.txt文件中,有一列包含说明,其中也包含空格.

请给出以上问题的解决方案.我必须用C#(无SSIS)编写代码
谢谢,
Yogesh Jumani

Hello Team,

I have one text(.txt)file that contain ''tab delimited'' data , i want to read that file and save value in data table.
In .txt File there is one column that contains description which also include space.

Please give solution for above problem.I have to write code in C# (no SSIS)
thanks ,
Yogesh Jumani

推荐答案

您可能会认为它有点复杂:TAB分隔的数据可以包含带引号的字符串,等等.
看看以下内容:快速CSV阅读器 [
It''s a bit more complex that you might think: TAB delimited data can contain quoted strings and so forth.
Have a look at this: A Fast CSV Reader[^] - you can select the seperator character and it will read the file for you.


参考: http://stackoverflow.com/questions/14954437/streamreader-with-tab-delimited-text-file [

您好,

感谢您的解决方案

我在下面的链接中使用了批量插入查询
使用批量将CSV或txt文件导入SQL Server插入. [
Hello,

Thanks for the solution

I used below link for bulk insert query
Import CSV or txt File Into SQL Server Using Bulk Insert.[^]

with the help of impersonate i copy paste file on server and that i insert record with bulk insert (share above link) and delete file from server

Thanks for solution


这篇关于包含“制表符分隔"的文本(.txt)文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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