|Hello, I need your help.
I want to read a .docx file line by line and insert chapters and paragraphs of the chapter in database table.
I have tried using Microsoft.Office.Interop.Word to read the document, without success because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
Now I read on google that the suitable tool for this is OpenXML.
My file.docx is divided for chapters and paragraphs of the chapter
The structure of file.docx
Chapter 1 - Events
-alert or disservices
Chapter 2 – Safety
Chapter 3 – Training
I need insert on database table according with this schema
How to do resolve this?
Thanks in advance for any help or suggestion
DROP TABLE IF EXISTS `chapters`;
CREATE TABLE `chapters` (
`chapter` longtext CHARACTER SET utf8 COLLATE utf8_general_ci,
`subheading` longtext CHARACTER SET utf8 COLLATE utf8_general_ci,
`contents` longtext CHARACTER SET utf8 COLLATE utf8_general_ci,
`sID` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`sID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;