在 vb.net 中重新格式化大文本文件
我面临一个相当大的文本文件(200-400 行)
该文件显示大量数据,但问题是它没有排列。 目前的数据类似于此
Column1 Column2 Column3 Column4
Bobby Fisher Virginia Rural
Willis Johnson Oklahoma City
Ryan Polk Nevada Suburban
Bruno Garfield Orgeon Rural
文件在每个条目之间使用一定数量的空格,这会导致问题。 有没有办法可以打破这个问题,并为每个单词允许 X 个空格,如果较短,请用空格填充空格?
我目前唯一的想法是从文本文件中提取每一行,然后提取每个单词。
有没有更简单的方法,或者我只是陷入了困境?
大多数人都能猜到最终产品会是什么样子,但它就是这样
Column1 Column2 Column3 Column4
Bobby Fisher Virginia Rural
Willis Johnson Oklahoma City
Ryan Polk Nevada Suburban
Bruno Garfield Orgeon Rural
I am faced with a rather large text file (200-400 lines)
The file displays a lot of data however the problem is that it is not lined up.
The data at the moment resembles this
Column1 Column2 Column3 Column4
Bobby Fisher Virginia Rural
Willis Johnson Oklahoma City
Ryan Polk Nevada Suburban
Bruno Garfield Orgeon Rural
The file uses a set number of spaces between each entry, which causes the problem.
Is there a way to possible break this up and for each word allow X amount of spaces, and if it is shorter fill in the space with spaces?
My only thought at the moment would be to pull each line from the text file and then pull each word.
Is there an easier way or am I just in a pretty big pickle?
Most of you all can guess what the end product will look like but here it is
Column1 Column2 Column3 Column4
Bobby Fisher Virginia Rural
Willis Johnson Oklahoma City
Ryan Polk Nevada Suburban
Bruno Garfield Orgeon Rural
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这能满足您的需要吗?
Does this do what you need?