如何使用SSIS将文本文件中的数据加载到单个列中

时间:2016-08-12 16:25:41

标签: ssis-2012

我有一个包含大量数据的文本文件,数据以逗号分隔。我正在尝试将数据加载到单个列中,然后使用派生列执行一些字符串函数以获取所需的数据并将其保存到CSV文件中。数据有很多噪音。每当我将数据加载到单个列并尝试使用字符串操作时,它会向我显示错误,指出数据是 DT_TEXT 格式。我试图将其强制转换为 DT_String 但到目前为止没有运气。

我猜也许我正在以错误的方式加载文本文件。每当我将它加载到一个列中时,我就会面临这个问题。

任何线索都会有很大的帮助!

文本文件中的数据如下所示。

{"ts":"2016-08-01T13:28:14.136","pid":2480,"tid":"2db4","sev":"info","req":"-","sess":"-","site":"-","user":"-","k":"rotate-log",
"v":{"new-path":"E:\\Tableau\\Tableau Server2\\data\\tabsvc\\vizqlserver\\Logs\\dataserver_0_2016_08_01_13_28_14.txt","old-path":"E:\\Tableau\\Tableau Server2\\data\\tabsvc\\vizqlserver\\Logs\\dataserver_0_2016_07_31_13_27_15.txt"}}
{"ts":"2016-08-01T13:28:14.120","pid":2480,"tid":"24c4","sev":"info","req":"-","sess":"-","site":"-","user":"-","k":"msg","v":"ACTION: DataSession::ReportException"}
{"ts":"2016-08-01T13:28:14.120","pid":2480,"tid":"24c4","sev":"warn","req":"-","sess":"-","site":"-","user":"-","k":"msg","v":"NotifyOfException::std::exception"}
{"ts":"2016-08-01T13:28:14.120","pid":2480,"tid":"24c4","sev":"warn","req":"-","sess":"-","site":"-","user":"-","k":"msg","v":"NotifyOfException caught std::exception."}
{"ts":"2016-08-01T13:28:14.183","pid":2480,"tid":"24c4","sev":"info","req":"-","sess":"-","site":"-","user":"-","k":"msg","v":"ACTION: DataSession::ReportException"}

非常感谢!

0 个答案:

没有答案