Skip to content

How to split a document after each heading? #611

Closed
@baranskib

Description

@baranskib

Hello,

I have multiple docx files in a folder and each of the docx has a couple of articles in it. The articles each have a heading and normal text. What I am trying to do is to iterate through all of those files and split each docx into separate text files. So if my original file1.docx has 4 articles, I want it to be split into 4 separate files each with its heading and text.

I got the part where it iterates through all of the files in a path and I can read the headings and text separately , but I can't seem to figure out a way how to merge it all and split it into separate files each with the heading and the text.

Any help will be appreciated, I hope that someone has already done something similar.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions