Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > PocketBook

Notices

Reply
 
Thread Tools Search this Thread
Old 11-06-2011, 06: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, 98 views)
neurocyp is offline   Reply With Quote
Old 11-10-2011, 11: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: 229
Karma: 1004766
Join Date: Jan 2010
Device: Kobo Aura HD, Pocketbook 302, Pocketbook 912, Nook STR, 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
 
Advertisement
Old 11-11-2011, 03: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, 06: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, 85 views)
neurocyp is offline   Reply With Quote
Old 11-17-2011, 05: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,781
Karma: 5640234
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
Old 11-18-2011, 07: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, 134 views)

Last edited by neurocyp; 11-18-2011 at 07:39 PM.
neurocyp is offline   Reply With Quote
Old 11-19-2011, 05: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,781
Karma: 5640234
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 05:26 AM.


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