解析空格/制表符分隔的文本文件并嵌入到 XL 文件中
您好,我有这种格式的文本文件
**4 1250000209852 01 XXXX XXXX V 3054XXX, XXXX J. 73227DUONG, DUC H.
672XXX COMM HOSP 40352405 RO
07/07/201010/05/2010HO
331.5 XXX NL PRESS XXX 70450 1 .00 OPA07/07/2010WEB 01/01/0001
07/06/201007/07/2010 WEB 01 01/01/0001SI 0 0 85 MDO CCHP C 0 01 125003/15/1925CT HEAD/XXX/W/O DYE 0**
,我的输出应该是这种格式的 Excel
Auth Status Member LNAME Member FNAME MI MEMBID DOB HPNAME DIAGCODE
Provider ID PCP Last Name PCP First Name PCP MI Requested Vendor Service Type
AUTHNO REQDATE AUTHDATE EXPRDATE
这里我编辑并详细说明了我的情况:
那么我如何将 txt 内容即时导出到 XL 或指导我通过映射两个不同文件的列的步骤。实际上,我的输入是空格分隔的文本文件、Excel 文件或 MS Access 数据库,其中任何一个。但输出仅在 Excel 中。因此,我需要一些逻辑来加载文件并映射并将文本传输到 XL 格式的结果文件(97-2003)。
Hi i have my text file in this format
**4 1250000209852 01 XXXX XXXX V 3054XXX, XXXX J. 73227DUONG, DUC H.
672XXX COMM HOSP 40352405 RO
07/07/201010/05/2010HO
331.5 XXX NL PRESS XXX 70450 1 .00 OPA07/07/2010WEB 01/01/0001
07/06/201007/07/2010 WEB 01 01/01/0001SI 0 0 85 MDO CCHP C 0 01 125003/15/1925CT HEAD/XXX/W/O DYE 0**
and my output should be in Excel in this format
Auth Status Member LNAME Member FNAME MI MEMBID DOB HPNAME DIAGCODE
Provider ID PCP Last Name PCP First Name PCP MI Requested Vendor Service Type
AUTHNO REQDATE AUTHDATE EXPRDATE
Here I edited and elaborated my situation:
So how do i export the txt contents to XL on the fly or guide me through the steps for mapping columns of two different files. Actually my inputs are in space separated text file, or Excel File or MS Access database, any of them. But output is in excel only. So I need some logic to load the file and map and transfer the text to resultant file in XL format (97-2003).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对你的源文件有点困惑......显示了多少行数据?
当你说
试图避免在 Excel 中打开文本文件并在“固定宽度”或“制表符分隔”之间进行选择并让 Excel 为您设置格式?
I'm slightly confused by your source file...how many rows of data are being displayed?
When you say
are you trying to avoid opening the text file in Excel and choosing between "fixed width" or "tab deliminated" and having Excel format it for you?