Category Archives: Content

Post contains a link to some sort of space-consuming file.

TextFileToTable Version 1.1

NEVER MIND. THE GNU PROJECT IMPRESSES AGAIN.

Please check out the org-mode to emacs for a program that did all this years ago.

http://orgmode.org/

Made a small change to the TextFileToTable script.  Now the user is able to exploit more of the Text::ASCIITable work with the addition of horizontal lines.

By inserting a ‘<<hr>>’ on a line by itself, the program will put another horizontal rule there.

# COMMAND

perl TextFileToTable.pl [delimiter] [File to be read]
perl TextFileToTable.pl \& data.txt

# INPUT

ID&Fruit&Color
1&apple&red
2&banana&yellow
<<hr>>
3&orange&orange

# OUTPUT

.----------------------.
| ID | Fruit  | Color  |
+----+--------+--------+
|  1 | apple  | red    |
|  2 | banana | yellow |
+----+--------+--------+
|  3 | orange | orange |
'----+--------+--------'

Grab the new script here:
http://www.megaupload.com/?d=H0N17GF9

Advertisements

Leave a comment

Filed under Computing, Content

Perl Script – Text File to a Table

I could not find a utility to turn a delimited text file into an ASCII table. So I built a simple one in Perl. It builds on this work by preparing the data for it.

The user creates a file with some delimiter, such as a Comma-Separated Values file, and then runs it through the script. The table is sent to standard output, and the user can do what they want with it.

It is run as such:

perl TextFileToTable.pl [delimiter] [file to be read]

For instance:

perl TextFileToTable.pl \& data.txt

The order is important.

The code, in an archive.

Leave a comment

Filed under Computing, Content