04-21-2017, 11:24 PM | #1 |
Autism Spectrum Disorder
Posts: 1,212
Karma: 6244877
Join Date: Sep 2011
Location: Coastal Texas
Device: Android Phone
|
Multiple Text File Problem
I'm having a bit of a problem with Sigil and my writing style. I write in .txt, with each chapter being a separate file. Chapter 001.txt, Chapter 002.txt, and so forth.
When I try the Calibre trick (zipping the files, converting them to an ePUB with Calibre, and then opening the resulting file in Sigil) has gotten me inconsistent results. Calibre seems to only convert what it thinks is the first chapter, and then purges the rest. I tried the OO import plugin, but it had some stylesheet problems. Anyone got a solution? Preferably an elegant one? |
04-22-2017, 02:29 AM | #2 | |||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Quote:
Concatenate all of your text files into a single one using the commandline: http://www.wikihow.com/Merge-Text-(....Command-Prompt then convert that using Calibre? B: Use Calibre to batch convert each text file to EPUBs, then use the EPUB Merge plugin? https://www.mobileread.com/forums/sh...d.php?t=169744 That will merge your Chapter 001 EPUB + Chapter 002 EPUB + [...] together into one. C: If using Microsoft Word, there is Import > Object > Text from File: https://support.office.com/en-us/art...f-3d8b585e03f1 Then save as whatever format (DOCX) and have Calibre convert it for you. Quote:
And since you know your input was plain text, you could just throw out all useless HTML and get yourself back down to this with some Search/Replace: Code:
<p>Paragraph 1.</p> <p>Paragraph 2.</p> Last edited by Tex2002ans; 04-22-2017 at 02:36 AM. |
|||
04-22-2017, 03:42 AM | #3 |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
In addition to Tex2002ans's excellent suggestions, you might want to also consider one of the following options:
1. Use a dedicated authoring tool for fiction writers, e.g., Scrivener, which allows you to generate epub and Kindle books. 2. Use an epub editor for users without HTML/CSS skills, e.g. Jutoh or Atlantis Word Processor. 3. If you're not afraid of using the terminal/command line, check out pandoc, which will convert markdown text files to epub files (and many other file formats). |
04-22-2017, 05:47 AM | #4 |
null operator (he/him)
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@teh603 - I'm assuming you use Windows.
For simplicity I would opt for Tex2002ans' option A. But rather than using the command line I would probably use this gadget - TXTcollector - Text file merging tool BR |
04-22-2017, 06:29 AM | #5 |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
Not elegant, to be sure, but why don't you just open Sigil in Book View and paste your first chapter into it? Then switch to Code View and get rid of the non-breaking spaces ( ) that Sigil puts in.
Now add your style sheet and link to it, something like this, before the <body> tag: <head> <title>Your Book Title Here</title> <link href="../Styles/epub.css" rel="stylesheet" type="text/css"/> </head> Now create a new file by placing your mouse cursor after the last character in the file and clicking on the Split at Cursor icon in the second menu line. The new file will contain the <head> tag you created above. Und so weiter through the book. |
04-22-2017, 09:07 AM | #6 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
04-22-2017, 09:39 AM | #7 |
Autism Spectrum Disorder
Posts: 1,212
Karma: 6244877
Join Date: Sep 2011
Location: Coastal Texas
Device: Android Phone
|
MacOS, actually.
The reason I'm asking here is because several years ago, I remember being able to convert .txt files to .xhtml within Sigil, but I can't seem to figure out how to do it anymore. Doitsu- I tend to prefer writing in .txt because "actual" word processors can have up to a full second of lag between when I start typing, and the keystrokes actually showing up on the screen. That's why I haven't been trying harder to fix the OO/LO plugin. Last edited by teh603; 04-22-2017 at 09:45 AM. |
04-22-2017, 11:03 AM | #8 | |
Well trained by Cats
Posts: 29,812
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Seriously: There is something odd going on with your setup. Are you using a Wireless Keyboard? Do you have other things (media player) running in background (VLC is playing music as I type this) Or are you just one of those OMG fast typists |
|
04-22-2017, 11:32 AM | #9 |
Autism Spectrum Disorder
Posts: 1,212
Karma: 6244877
Join Date: Sep 2011
Location: Coastal Texas
Device: Android Phone
|
I'm an OMG fast typist. My fiancee won't allow me to have a mechanical keyboard because I make enough noise on a regular one. And on pretty much every system I've had, OO/LO has noticeable typing lag.
That having been said, I also haven't tried "serious" writing in OO/LO since before I upgraded to 8 gigs of RAM, so it could be less of an issue now. |
04-22-2017, 12:36 PM | #10 |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
AFAIK, there are lots of distraction-free editors for macOS with Markdown support and Markdown files can be easily converted to epubs with pandoc and calibre.
|
04-22-2017, 01:32 PM | #11 |
Sigil Developer
Posts: 7,651
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Have you tried Sigil's "Add Existing Files" (right click in FileBrowser) and then change the Filter to "All Files" and then muli-select the text files.
Does that work? |
04-22-2017, 01:38 PM | #12 | |
Autism Spectrum Disorder
Posts: 1,212
Karma: 6244877
Join Date: Sep 2011
Location: Coastal Texas
Device: Android Phone
|
Quote:
I guess this is where a plugin would be nice, but I haven't written functional code since the Apple II was still a thing. |
|
04-22-2017, 05:59 PM | #13 |
null operator (he/him)
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
04-22-2017, 06:08 PM | #14 |
Sigil Developer
Posts: 7,651
Karma: 5433388
Join Date: Nov 2009
Device: many
|
OSX is a full BSD unix,
cd YOURFOLDER cat *.txt > ../combined.txt Will concatinate the files in file name sort order. If you want a different order you can do things one by one as well. |
04-23-2017, 12:27 AM | #15 | |||||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
You could either copy/paste one chapter at a time, or concatenate and paste the entire text file into Book View. That should get you the very basic <p> tags, then you could work from there. Quote:
And which plugin are you talking about exactly? Quote:
https://www.reddit.com/r/MechanicalK...oard_overviews Your fingers will thank you! Quote:
Quote:
Code:
<body> <p> </p> </body> Code:
<p> blahblahblah</p> Last edited by Tex2002ans; 04-23-2017 at 12:30 AM. |
|||||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
I made my .opf file w/ Text Wranger; could that be a problem? | petercrowell | Kindle Formats | 14 | 05-02-2012 04:00 PM |
diff & automerge multiple text files | SBT | Workshop | 3 | 04-25-2012 10:47 AM |
Converting multiple text files to xhtml? | Spotnik | Sigil | 19 | 04-12-2011 10:37 PM |
Convert zip with multiple text files to MOBI | mindfire | Calibre | 1 | 03-27-2010 10:19 AM |
How best to handle multiple edits to original text | KAM | Calibre | 2 | 02-08-2009 11:09 AM |