在哪里可以找到文本/ascii 表/网格生成器的实现?
在哪里可以找到文本/ascii 表/网格生成器的实现?例如,给定一个如下所示的 CSV 文件:
Header1,Header2,Header3 Pizza,Artichoke dip,Bob's Special of the Day BLT,Ham on rye with the works,
它将生成一个漂亮的文本表,如下所示:
Header1 Header2 Header3 ---------------------------------------- Pizza Artichoke Bob's Special of the Day BLT Ham on rye with the works
好的功能是能够指定每列的字符数并为 .NET 实现。我对输入格式或输出不太挑剔;我只是在寻找一些东西来完成工作。
我花了一些时间在网上搜索这个,但是你知道当你开始搜索“ascii table”时会发生什么......希望在我推出自己的实现之前找到一些东西。提前致谢。
Where can I find an implementation for a text/ascii table/grid generator? e.g. Given a CSV file such as this:
Header1,Header2,Header3 Pizza,Artichoke dip,Bob's Special of the Day BLT,Ham on rye with the works,
It would generate a nice looking text table such as this:
Header1 Header2 Header3 ---------------------------------------- Pizza Artichoke Bob's Special of the Day BLT Ham on rye with the works
Nice features to have would be the ability to specify the number of characters per column and implemented for .NET. I'm not too particular about the input format or the output; I'm just looking for something to get the job done.
I spent a bit of time searching for this online, but you know what happens when you start searching for "ascii table"... Hoping to find something before I roll my own implementation. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
C# 字符串格式化程序 (System.String.Format) 具有可用的固定宽度格式。不支持多行内容,因为它不一定与输入的文本顺序相同。
The C# string formatter (System.String.Format) has fixed width formats available. Multi-line stuff isn't supported, as it's not necessarily in the same order as the text inputted.
怎么样
将分隔符转换为固定宽度的最佳方法
How about
the best way to convert delimited to fixed width
我刚刚为此目的编写了 tablign 。安装
并
会给你
如果需要的话,也许我可以添加一个
max-col-width
参数。I just wrote tablign for this exact purpose. Install with
and
will give you
Perhaps I could add a
max-col-width
parameter if the need appears.