09 May 2018
macOS TextUtil Convert TXT to DOCX, CAT All DOCX to One DOCX
Today, I had the need to convert a homebrew extension to DOCX extension. I renamed all the custom extensions to the TXT extension. There was no formatting in the original files like bold or italicizing so textutil stripping it didn’t matter. I found OSXDaily’s post to be a helpful guide for a Terminal tool I didn’t know existed already on macOS. And I also needed to catenate multiple files into one file but using the file1.text file2.txt etc. from OSXDaily’s second post in the command line didn’t work for me so I modified the conversion command to a cat command and it worked. I found the converted file in the Home root folder possibly because in the command I only wrote the filename but didn’t specify a path for it.
textutil -convert docx /Users/username/Desktop/folder/*.txt (convert all TXT files to DOCX files)
textutil -cat docx /Users/username/Desktop/folder/*.docx -output /Users/username/Desktop/folder/combinedFilename.docx (catenate all DOCX files into one DOCX file)