如何对文件中的可变长度数据行进行排序 [英] How to sort the variable length data row in a file

查看:65
本文介绍了如何对文件中的可变长度数据行进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个可变行长的文件,如下所示:



MAMMOGRAPHY INC,XXXXX1706,XXXXXXXX4708,

ABC INC。,XXXXX0742,XXXXXX2401,



我需要将MAMMOGRAPHY INC存储在数据中table as Name和K2CLICK INC也应该保存在与Name相同的数据表中......有没有办法可以在同一个逻辑中完成。请帮助。



谢谢。

Hi All,

I have a file with variable row length like this:

MAMMOGRAPHY INC,XXXXX1706,XXXXXXXX4708,
ABC INC.,XXXXX0742,XXXXXX2401,

I need to store the "MAMMOGRAPHY INC" in a data table as Name and K2CLICK INC should also be saved in the same data table as Name...Is there a way where these can be done in the same logic.Please help.

Thanks.

推荐答案

由于你没有给出很多信息,我会尽我所能,



从您提供的样本中,



MAMMOGRAPHY INC,XXXXX1706,XXXXXXXX4708,

ABC INC。,XXXXX0742,XXXXXX2401,



看来你处理逗号分隔值。你最好的选择是分开逗号



http://www.dotnetperls .com / split [ ^ ]



并将值存储在数据库的相应列中,带插入



http://www.w3schools.com/sql/sql_insert.asp [ ^ ]



或更新



http://www.w3schools.com/sql/sql_update.asp [ ^ ]



希望有所帮助,
Since you didnt give alot of info i will do my best,

From the sample you provided,

MAMMOGRAPHY INC,XXXXX1706,XXXXXXXX4708,
ABC INC.,XXXXX0742,XXXXXX2401,

It appears your dealing with comma separated values. Your best bet is to split on the comma

http://www.dotnetperls.com/split[^]

And the store the values in the appropriate columns in your database, with an insert

http://www.w3schools.com/sql/sql_insert.asp[^]

or an update

http://www.w3schools.com/sql/sql_update.asp[^]

Hope that helps,


这篇关于如何对文件中的可变长度数据行进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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