Convert ODT to TXT with a Macro?

asked 2020-01-18 11:51:45 +0200

Clockman gravatar image

I wish to convert hundreds of .ODT files to .TXT in order to extract data from the results and edit it into .SQL statements to load a MySQL database. I installed cygwin and ran "/cygdrive/c/Program Files/LibreOffice/program/soffice.exe" --convert-to txt --outdir . M*.odt, which worked. My query is 'Can I do the same thing with a LibreOffice macro within writer? I ask this because I have such a macro in MSWord which prompts for a folder name then runs the conversion from DOC to TXT. I copied this macro into LO but it failed on a DIM statement where an oject is defined as TYPE Document, LO does not allow this. Does it have an equivalent? It would be nice to be able to do conversions without having to install a unix-like environment. On the other hand I will probably need commands like grep, sed & awk in order to process the text files. Thanks for any help Chris

edit retag flag offensive close merge delete

Comments

1

Why would you need cygwin for that?

Use normal Windows CMD.exe; you just need to account for its globbing differences - see this question.

Mike Kaganski gravatar imageMike Kaganski ( 2020-01-18 11:56:52 +0200 )edit
carnish gravatar imagecarnish ( 2020-01-18 17:23:48 +0200 )edit