Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 06-21-2025, 04:40 PM   #1
hfdt
Junior Member
hfdt began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jun 2025
Device: Kindle Paperwhite
Convert Thousands of DOCX Files into One AZW3 (with Tappable TOC)

Hi, all.

I do at least one page of journaling in Microsoft Word every day, and sometimes I find it interesting / grounding to re-read past journal entries, and I would like to do that re-reading on my Kindle Paperwhite. I've managed to get several entries onto the device using Calibre; that's not a problem. What I'm looking to do now is this:

I want one AZW3 file with ALL these old journal entries in it, and I want it to have a tappable TOC with a link to each entry.

The thing is, I've been doing this for a long time, and I have over eight thousand individual .docx files that would need to be incorporated. A friend suggested I convert the pile of .docx files into one giant PDF and then convert the PDF into AZW3, because when you combine files in Acrobat, it bookmarks each separate file automatically unless you tell it not to. I tried this, but I could not find a way to parlay those bookmarks into a TOC in Calibre - and in any case, I've since read that PDF is not ideal as a starting format.

Any ideas how I can get from a pile of .docx files to one massive AZW3 with a tappable TOC?

Thanks in advance.
hfdt is offline   Reply With Quote
Old 06-21-2025, 07:36 PM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,687
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
I would use Word's Insert->Object->Object and/or Text File tools to create a merged DOCX and convert that to AZW3.

Click image for larger version

Name:	Screenshot 2025-06-22 090544.jpg
Views:	8
Size:	214.6 KB
ID:	216394

You may need to adjust the Convert->Structure->XPath…

Click image for larger version

Name:	Screenshot 2025-06-22 093403.jpg
Views:	6
Size:	225.7 KB
ID:	216395

…to get the ToC you want.

BR

Last edited by BetterRed; 06-21-2025 at 07:50 PM. Reason: add last lime [sic]
BetterRed is offline   Reply With Quote
Advert
Old 06-21-2025, 11:06 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,293
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
convert them to epub and use the epubmerge plugin and then convert the rsulting merged epub to azw3.
kovidgoyal is offline   Reply With Quote
Old 06-21-2025, 11:31 PM   #4
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,429
Karma: 78880114
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
You could even convert all the files to ePub at the command line using ebook-convert, and then use epubmerge plugin to combine them all.
PeterT is offline   Reply With Quote
Old 06-22-2025, 07:37 AM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,687
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Just for fun I asked ChatGPT, "How to Concatenate Multiple DOCX Files with File Names as Headers". Here's the response.


Quote:
To concatenate multiple DOCX files and insert each file’s name as a header before its content, you can do this manually in Microsoft Word or automate it using a script.

⚙️ Automated Method (Using Python + python-docx)
If you have many files, automation is your friend. Here’s a Python script that does the job:
Code:
from docx import Document
import os

def merge_docs_with_headers(folder_path, output_path):
    merged_doc = Document()

    for filename in sorted(os.listdir(folder_path)):
        if filename.endswith(".docx"):
            file_path = os.path.join(folder_path, filename)
            doc = Document(file_path)

            # Add file name as a heading
            merged_doc.add_heading(filename, level=1)

            # Append content
            for element in doc.element.body:
                merged_doc.element.body.append(element)

    merged_doc.save(output_path)

# Example usage
merge_docs_with_headers("path/to/your/docx/files", "merged_output.docx")

This script:
- Loops through all .docx files in a folder.
- Adds each file’s name as a heading.
- Appends the content of each file to the master document.
You’ll need to install the python-docx library if you haven’t already: pip install python-docx
BR
BetterRed is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert form Zip including Docx files to EPUB The_book Conversion 1 03-22-2022 12:45 PM
english india newspaper when convert from mobi to azw3 disfunction ToC Skumar Recipes 5 02-11-2019 12:27 AM
Some docx files convert to blank epubs wftl Conversion 1 03-19-2018 08:23 PM
Invalid TOC links in some azw3 files darryl Kindle Formats 53 05-12-2015 08:11 PM
Problem with creation of ToC from docx to azw3 Matak Conversion 3 03-28-2014 07:35 PM


All times are GMT -4. The time now is 06:48 AM.


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