Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > PocketBook

Notices

Reply
 
Thread Tools Search this Thread
Old 11-06-2011, 05:55 PM   #1
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
Reflow script for txt files

Hi,
I usually read with "txt" files, and it finally occured to me, that I can write script, that could permanently reflow a file, I would like to read.

I installed it into extensions.cfg file, so the txt file I have configured as:

Code:
txt:@Text_file:1:fbreader.app,cr3.app,reflow.app,fbreader180.app:ICON_TXT
Now i can use "run with" function in the explorer, and pick "reflow", and I would have a file reflown. The script makes backup file, which would it refuse to overwrite

btw, It also strips "\r" characters

have, fun anyway,
and regards
Cyprian
Attached Files
File Type: gz reflow.sh.tar.gz (1.1 KB, 343 views)
neurocyp is offline   Reply With Quote
Old 11-10-2011, 10:16 AM   #2
JimMcLaren
Addict
JimMcLaren ought to be getting tired of karma fortunes by now.JimMcLaren ought to be getting tired of karma fortunes by now.JimMcLaren ought to be getting tired of karma fortunes by now.JimMcLaren ought to be getting tired of karma fortunes by now.JimMcLaren ought to be getting tired of karma fortunes by now.JimMcLaren ought to be getting tired of karma fortunes by now.JimMcLaren ought to be getting tired of karma fortunes by now.JimMcLaren ought to be getting tired of karma fortunes by now.JimMcLaren ought to be getting tired of karma fortunes by now.JimMcLaren ought to be getting tired of karma fortunes by now.JimMcLaren ought to be getting tired of karma fortunes by now.
 
JimMcLaren's Avatar
 
Posts: 260
Karma: 1014230
Join Date: Jan 2010
Device: Onyx Boox T68, Kobo Aura HD, Pocketbook 302, Pocketbook 912, Nook HD+
I could have used this recently but instead used Calibre to create epubs from the text files I wanted to read. It does a passable job on about 3/4 of the files I read and it usually makes a pretty good attempt at creating a table of contents. The few times it fails to create a good epub, the text is centered on the page which I find hard to read.

Thanks for doing this. Yet another tool to read with on these great readers.
JimMcLaren is offline   Reply With Quote
Advert
Old 11-11-2011, 02:03 PM   #3
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
I'm thinking about doing fewo changes, so we wuld have different reflow modes, with different line breaking mode. I would use new fbreader, but using large text files with fbreader180 is not such a good idea, as it looses pages, that is why i started this script
neurocyp is offline   Reply With Quote
Old 11-16-2011, 05:02 PM   #4
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
Hi,
I've updated the reflow script,
what you have to do is unzip the script into:
/system/share/reflow.sh
I added comments, so anybody, could easily understand and modify it.

regards
Cyprian
Attached Files
File Type: zip reflow_awk_Script.zip (776 Bytes, 305 views)
neurocyp is offline   Reply With Quote
Old 11-17-2011, 04:38 AM   #5
paola
Wizard
paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.
 
paola's Avatar
 
Posts: 2,824
Karma: 5843878
Join Date: Oct 2010
Location: UK
Device: Pocketbook Pro 903, (beloved Pocketbook 360 RIP), Kobo Mini, Kobo Aura
thanks!
paola is offline   Reply With Quote
Advert
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, 367 views)

Last edited by neurocyp; 11-18-2011 at 06:39 PM.
neurocyp is offline   Reply With Quote
Old 11-19-2011, 04:57 AM   #7
paola
Wizard
paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.paola ought to be getting tired of karma fortunes by now.
 
paola's Avatar
 
Posts: 2,824
Karma: 5843878
Join Date: Oct 2010
Location: UK
Device: Pocketbook Pro 903, (beloved Pocketbook 360 RIP), Kobo Mini, Kobo Aura
super: thanks!
paola is offline   Reply With Quote
Reply

Tags
reflow, txt, txt conversion


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reflow text in PDF-files? Dava Amazon Kindle 6 03-11-2011 10:39 AM
Firmware Update Do people think reflow will be available for pdf files? varmemester Amazon Kindle 16 10-07-2010 06:58 PM
Txt files - Convert to Epub - Multiple files into one book - noob help Cernan Calibre 6 05-18-2010 10:12 AM
Script to convert a directory full of files? mdibella Kindle Formats 2 10-14-2008 01:21 PM
gDrive 0.6 - PHP script to store files on Gmail TadW Lounge 0 02-24-2005 05:08 PM


All times are GMT -4. The time now is 01:56 PM.


MobileRead.com is a privately owned, operated and funded community.