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

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 11-20-2007, 12:18 AM   #1
profnachos
Connoisseur
profnachos began at the beginning.
 
Posts: 52
Karma: 43
Join Date: Nov 2007
Device: Palm Treo
utility to eliminate unwanted line breaks in txt

I have written a little program to eliminate unwanted line breaks from txt files converted from PDF (I am a freelance programmer). This after getting unsatisfying responses to this thread I posted. Nothing personal against those who helped, but none of the options looked attractive.

So what you will do is, open a PDF file using your Adobe Reader, chose the option to "Save as Text." Once the pdf file has been converted to txt, you'd use my utility to get rid of unwanted lines before importing it a format of your choice.

I'd love to make it available to the public and get feedback, but the only problem is, I do not have a public website to make the program available to you. So let me know if you wish to corroborate with me on this.

Also, if the interest level is high, I would like to write an utility to fix HTML files to do the same.

If somebody has done this already, please let me know.

Thanks. My email is profnachos@gmail.com
profnachos is offline   Reply With Quote
Old 11-20-2007, 02:11 AM   #2
NatCh
Gizmologist
NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.
 
NatCh's Avatar
 
Posts: 11,605
Karma: 926222
Join Date: Jan 2006
Location: Republic of Texas Embassy at Jackson, TN
Device: Nook STGR
Hey, profnachos, you're probably not going to get much attention right now, not because you don't deserve it, but because everyone is in a frenzy over the Kindle Launch. I'd suggest you give it a few days to die down and try it then.

Also, a number of folks have used this forum to collaborate on apps, so you might want to consider that option.
NatCh is offline   Reply With Quote
 
Enthusiast
Old 11-20-2007, 02:30 AM   #3
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 60,966
Karma: 38191451
Join Date: Nov 2006
Location: UK
Device: Kindle PW2, iPad Retina Mini, iPhone 4, MS Surface Pro
What makes your newline remover better than any of the dozen or so similar ones that we already have?
HarryT is online now   Reply With Quote
Old 11-20-2007, 02:40 AM   #4
profnachos
Connoisseur
profnachos began at the beginning.
 
Posts: 52
Karma: 43
Join Date: Nov 2007
Device: Palm Treo
Quote:
Originally Posted by HarryT View Post
What makes your newline remover better than any of the dozen or so similar ones that we already have?
I never made that claim, and I specifically sought for a useful tool to do the same in this post , but of the responses in the thread pointed to "the dozen or so similar ones we already have."

Perhaps you can list the dozen or so similar ones, so I don't have to continue to work on this.

If you are looking for an online piss fight, then move on. Not interested.
profnachos is offline   Reply With Quote
Old 11-20-2007, 03:34 AM   #5
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 60,966
Karma: 38191451
Join Date: Nov 2006
Location: UK
Device: Kindle PW2, iPad Retina Mini, iPhone 4, MS Surface Pro
There's no need to be impolite. I'm certainly not criticising your work; I was wondering what benefits your tool offered over those which already exist?

If you have "Word" on your PC, an excellent alterative is Stingo's Word Macro (search the forum for it) which, in addition to removing newlines, does a number of other tidying up operations too.

A tool that I've used myself is a little command-line freeware app called "textify" which offers a range of nice formatting options for text files (eg leaving blank lines between paragraphs, no blank lines but indentation, or wrapping up the text file in "<P>" HTML paragraph markers. A Google search will find it.

Another much more sophisticated tool is "Gutenmark" (http://www.sandroid.org/GutenMark/) which has all sorts of facilities for converting plain text to marked-up HTML.

Doing a Google search for "freeware newline remover" will show many more.

What facilities does your tool offer?
HarryT is online now   Reply With Quote
Old 11-20-2007, 11:58 AM   #6
profnachos
Connoisseur
profnachos began at the beginning.
 
Posts: 52
Karma: 43
Join Date: Nov 2007
Device: Palm Treo
I apologize for the tone of my response. I thought your response read, "What makes you THINK," which was not the case. I need a reading comprehension course

I will look them up. No, there is nothing special about my tool, and your suggestions look great.

Quote:
Originally Posted by HarryT View Post
There's no need to be impolite. I'm certainly not criticising your work; I was wondering what benefits your tool offered over those which already exist?

If you have "Word" on your PC, an excellent alterative is Stingo's Word Macro (search the forum for it) which, in addition to removing newlines, does a number of other tidying up operations too.

A tool that I've used myself is a little command-line freeware app called "textify" which offers a range of nice formatting options for text files (eg leaving blank lines between paragraphs, no blank lines but indentation, or wrapping up the text file in "<P>" HTML paragraph markers. A Google search will find it.

Another much more sophisticated tool is "Gutenmark" (http://www.sandroid.org/GutenMark/) which has all sorts of facilities for converting plain text to marked-up HTML.

Doing a Google search for "freeware newline remover" will show many more.

What facilities does your tool offer?
profnachos is offline   Reply With Quote
Old 11-20-2007, 12:02 PM   #7
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 60,966
Karma: 38191451
Join Date: Nov 2006
Location: UK
Device: Kindle PW2, iPad Retina Mini, iPhone 4, MS Surface Pro
No problem - this is a very easy medium in which to misunderstand the tone of a post.
HarryT is online now   Reply With Quote
Old 11-23-2007, 03:08 AM   #8
profnachos
Connoisseur
profnachos began at the beginning.
 
Posts: 52
Karma: 43
Join Date: Nov 2007
Device: Palm Treo
Quote:
Originally Posted by HarryT View Post
There's no need to be impolite. I'm certainly not criticising your work; I was wondering what benefits your tool offered over those which already exist?

If you have "Word" on your PC, an excellent alterative is Stingo's Word Macro (search the forum for it) which, in addition to removing newlines, does a number of other tidying up operations too.

A tool that I've used myself is a little command-line freeware app called "textify" which offers a range of nice formatting options for text files (eg leaving blank lines between paragraphs, no blank lines but indentation, or wrapping up the text file in "<P>" HTML paragraph markers. A Google search will find it.

Another much more sophisticated tool is "Gutenmark" (http://www.sandroid.org/GutenMark/) which has all sorts of facilities for converting plain text to marked-up HTML.

Doing a Google search for "freeware newline remover" will show many more.

What facilities does your tool offer?
Harry, are there tools that rework an html file that has the <br> tags all over the place. When you use pdftohtml, that is what happens. It does not differentiate between paragraphs and line breaks.

All the tools you mentioned are for txt files. Thanks.
profnachos is offline   Reply With Quote
Old 11-23-2007, 03:13 AM   #9
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 60,966
Karma: 38191451
Join Date: Nov 2006
Location: UK
Device: Kindle PW2, iPad Retina Mini, iPhone 4, MS Surface Pro
Could you not do it the same way that the text file clean-up tools work - treat two consecutive <br>'s as a paragraph break, and then delete all the others? That's all that springs to mind at present, I'm afraid!
HarryT is online now   Reply With Quote
Old 11-23-2007, 08:37 AM   #10
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
Posts: 2,679
Karma: 2799391
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
Quote:
Originally Posted by profnachos View Post
I have written a little program to eliminate unwanted line breaks from txt files converted from PDF ... I'd love to make it available to the public and get feedback, but the only problem is, I do not have a public website to make the program available to you.
Yes, I would like to try/test your program.

You can attach a file to your post here. Many people do.
You can register on one of many servers like SourceForge.
You can register on some freehosting server.
You can upload your file to rapidshare server.

By the way.
Have you seen par?
http://www.nicemice.net/par/
kacir is online now   Reply With Quote
Old 11-27-2007, 06:23 PM   #11
profnachos
Connoisseur
profnachos began at the beginning.
 
Posts: 52
Karma: 43
Join Date: Nov 2007
Device: Palm Treo
Quote:
Originally Posted by HarryT View Post
Could you not do it the same way that the text file clean-up tools work - treat two consecutive <br>'s as a paragraph break, and then delete all the others? That's all that springs to mind at present, I'm afraid!
Well, not all paragraphs are handled with two consecutive br tags. I converted Crime and Punishment from PDF to HTML with pdftohtml. I don't see two consecutive <br>'s anywhere.

I am thinking that if there is a period right before the <br> tag, that is the end of the paragraph. Of course it won't always be right, but that seems to be the best "guess."

Last edited by profnachos; 11-27-2007 at 07:22 PM.
profnachos is offline   Reply With Quote
Old 11-27-2007, 06:24 PM   #12
profnachos
Connoisseur
profnachos began at the beginning.
 
Posts: 52
Karma: 43
Join Date: Nov 2007
Device: Palm Treo
Quote:
Originally Posted by kacir View Post
Yes, I would like to try/test your program.

You can attach a file to your post here. Many people do.
You can register on one of many servers like SourceForge.
You can register on some freehosting server.
You can upload your file to rapidshare server.

By the way.
Have you seen par?
http://www.nicemice.net/par/
I think I want to focus on a tool to clean up HTML. Looks like Gutenmark which gets a mention above already does a decent job of cleaning up text files, so there is no need to reinvent the wheel.
profnachos is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre making unwanted chapter breaks PatNY Calibre 6 10-08-2010 09:58 PM
Spurious Line Breaks Halk Workshop 1 05-15-2010 01:22 PM
Chapters and page breaks in TXT files scarab1 Ectaco jetBook 0 03-06-2010 02:08 PM
No line breaks in TXT conversions - is it just me? TMF Calibre 3 09-24-2009 02:46 PM
No line breaks ecpepper Amazon Kindle 3 08-09-2009 06:42 PM


All times are GMT -4. The time now is 02:51 PM.


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