View Single Post
Old 11-18-2011, 06:32 PM   #6
neurocyp
Junior Member
neurocyp plays well with othersneurocyp plays well with othersneurocyp plays well with othersneurocyp plays well with othersneurocyp plays well with othersneurocyp plays well with othersneurocyp plays well with othersneurocyp plays well with othersneurocyp plays well with othersneurocyp plays well with othersneurocyp plays well with others
 
Posts: 5
Karma: 2954
Join Date: May 2011
Device: iLiad
Ok, this is probably the last update.
Here is a new version, with undo.
You can run reflow.app against the same file over and over again, and then undo.
Install it in your extensions, then press ok for a while on a text file, and pick "reflow" or "undo".
There is an example text file, that was processed by the script, it is a book from project gutenberg: http://www.gutenberg.org/cache/epub/23428/pg23428.txt


The reflowing script consists of 3 parts:
1. shell script, that controls the process
2. awk script that is run before actual reflowing
3. awk reflow script

It can recognise various types of entries, for eg. input lines like these below:
THIS IS ONLY UPPERCASE
1. this is punctation
1 this is punctation
123.
1023 Index ............ 12
would be always be not modified in output.


**** INSTALLATION
Unzip the archive in your /system directory in the internal memory.

To install this script in your pocketbook edit file:
system/config/extensions.cfg
find the line beginning with:
txt:@Text_file:1:
and add
reflow.app,undo.app
before
:ICON_TXT

my entry is for eg. this:
Code:
txt:@Text_file:1:fbreader.app,reflow.app,undo.app:ICON_TXT
Scripts controlling the process:

reflow.app - txt file reflow, it supports multi undo action
undo.app - undo last reflow (just add to config)

Awk scripts:

reflow.awk - the main script, that does the processing.
stat_text.awk is preanalisis, you can extend it whater you want


just try it yourself
Attached Files
File Type: zip reflow.sh.zip (332.2 KB, 377 views)

Last edited by neurocyp; 11-18-2011 at 06:39 PM.
neurocyp is offline   Reply With Quote