将文本文件解析为excel [英] Parse out text file into excel

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

问题描述

嗨社区 -



我有数百个文本文件,一行一行:



例子



开启:

名字:乔

姓氏:史密斯

年龄:32

州:俄亥俄州

结束:

开放时间:

名字:迈克

姓氏:Watkins

年龄:54

州:新泽西州

结束:



我需要做的是解析文本文件并将它们放在excel表的一行中,如下所示:



列A栏B栏C栏D

Joe Smith 32俄亥俄州

Mike Watkins 54新泽西州



现在,解析出一个excel文件 - 谷歌上有多个解释,但是,我不知道如何在:符号后解析并在一行上放置任何东西,从Open:到结束:



有没有人知道或可以提供帮助的资源?



T高级的hanks。



daveofgv

Hi Community -

I have hundreds of text files that have one item line by line:

Example

Open:
FirstName: Joe
LastName: Smith
Age: 32
State: Ohio
End:
Open:
FirstName: Mike
LastName: Watkins
Age: 54
State: New Jersey
End:

And what I need to do is parse out the text files and put them in one row of an excel sheet so it looks like:

Column A Column B Column C Column D
Joe Smith 32 Ohio
Mike Watkins 54 New Jersey

Now, parsing out to an excel file - there are multiple explanations on google, however, i am not sure how to parse out after the : symbol and put on one line for anything from Open: to End:

Are there any resources about this that anyone knows of or can help?

Thanks in advanced.

daveofgv

推荐答案

最简单的方法是从中创建一个.csv文件你的投入。然后,Excel可以读取csv并将其直接转换为电子表格格式。或者你也可以使用Excel Interop,但这更难处理。
The simplest way would be to create a .csv file from your inputs. Excel can then read the csv and convert it directly to spreadsheet format. Alternatively you could use the Excel Interop, but that is much harder to work with.


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

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