Hack Forums
[Shell] Stream redirection for combining office files? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] Stream redirection for combining office files? (/showthread.php?tid=5174234)



Stream redirection for combining office files? - ๖ۣۜSolace - Feb 17, 2016

Heyo,
just wondering if anybody could help me out here. I'd like to use stream redirection to combine multiple files, (.docx, .pptx, etc) into one larger file. I'm assuming that "cat file1.docx >> file2.docx" doesn't work, as the headers and footers are repeated throughout the file. Is there any way that I could go about stripping just the headers and footers?

Thanks


* - Pseudonym - Feb 17, 2016

It isn't possible to do it like this. .docx, .pptx and all similar modern file formats are binary (zips with multiple xml and other kind of files). Maybe there is some utility dedicated to do this, but it definitely isn't possible just with command line. But unless you plan to edit the files afterwards, it should be simple enough to convert all documents to pdfs and then concatenate them.