Grant Weasner wrote to All <=-
Hello all.
I'm wondering what others think about linux a text formating task I'm trying to solve.
I've got lots of older howtos from the old web, and stuff I've also
wrote.
I want to convert all of my text files in many directories into a
gopher fiendly format.
Gopher friendly:
1) 64 columns wide.
2) any indents will remain, but if a line goes beyond 64 cols, the remaining characters will go to the line below but indent to the same column as the prior line.
This seems pretty difficult and I'm wondering how others would approch this task.
I'm thinking of just writing a python script using basic python
modules.
But I'm wondering if there are just native linux tools that would work
as good or better.
Grant Weasner wrote to All <=-
Hello all.
I'm wondering what others think about linux a text formating task I'm trying to solve.
I've got lots of older howtos from the old web, and stuff I've also wrote.
I want to convert all of my text files in many directories into a gopher fiendly format.
Gopher friendly:
1) 64 columns wide.
2) any indents will remain, but if a line goes beyond 64 cols, the remaining characters will go to the line below but
indent
to the same column as the prior line.
This seems pretty difficult and I'm wondering how others would approch this task.
I'm thinking of just writing a python script using basic python modules.
But I'm wondering if there are just native linux tools that would work as good or better.
<SNIP>
man fold
Dan Clough wrote to Grant Weasner <=-
man fold
Sean Dennis wrote to Dan Clough <=-
Dan Clough wrote to Grant Weasner <=-
man fold
fold is an amazing utility. Very helpful with text files.
Indeed it is. A classic *nix utility - do one thing, and do it well.
When I was publishing th FidoGazette, I used fold a lot in
reformatting,
Yes, very handy for making "wide" stuff fit on a 80x25 character
screen. :-)
Sean Dennis wrote to Dan Clough <=-
Dan Clough wrote to Grant Weasner <=-
man fold
fold is an amazing utility. Very helpful with text files.
When I was publishing th FidoGazette, I used fold a lot in
reformatting,
I want to convert all of my text files in many directories into a gopher fiendly format.
Gopher friendly:
1) 64 columns wide.
2) any indents will remain, but if a line goes beyond 64 cols, the remaining characters will go to the line below but indent to the same column as the prior line.
This seems pretty difficult and I'm wondering how others would approch this task.
Nigel Reed wrote to All <=-
Dan Clough wrote to Grant Weasner <=-
man fold
fold is an amazing utility. Very helpful with text files.
Indeed it is. A classic *nix utility - do one thing, and do it well.
When I was publishing th FidoGazette, I used fold a lot in reformatting,
Yes, very handy for making "wide" stuff fit on a 80x25 character
screen. :-)
So many useful, and maybe not so useful utilities out there.
paste, will take 2 or more files and put them next to each other, like
a sideways cat :)
Talking of cat, there is also tac which will display a file from the bottom up.
ncal is like cat but with the days down the side.
To randomly shuffle the lines of a text file you can pipe it into shuf
fmt is another text processor similar to, but different from fold.
Sysop: | altere |
---|---|
Location: | Houston, TX |
Users: | 69 |
Nodes: | 4 (0 / 4) |
Uptime: | 04:57:57 |
Calls: | 1,156 |
Calls today: | 4 |
Files: | 8,173 |
Messages: | 300,205 |