Convert ODT to TXT with a Macro?

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

Why would you need cygwin for that?

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

See this Download odt2txt 0.3