Since I'm not programmer and making macros is out of my league, I solved this easier way.
1. I made a batch ".bat" file for windows.
Code: Select all
for /f "delims=|" %%f in ('dir /b .\ODSDIRECTORY') do "C:\Program Files (x86)\LibreOffice 4\program\soffice.exe" --headless --convert-to csv:"Text - txt - csv (StarCalc)":"59,ANSI,1" --outdir .\CSV ".\ODSDIRECTORY\%%f"
exit
What it does is next:
- searches all files in directory
- for every file in directory it executes command after "do"
- "delims=|" takes into account files with spaces in name, but files with brackets will not pass, and probably also files with other strange characters
- "C:\Program Files (x86)\LibreOffice 4\program\soffice.exe" is path name to LO or AOO, if it's not global command
--convert-to csv:"Text - txt - csv (StarCalc)":"59,ANSI,1" for this part thanks to rudolfo, without him it wouldn't be possible
--outdir .\CSV this is only if you want to have output directory different then directory where your command is executed
- ".\ODSDIRECTORY\%%f" this points to files which will be converted, if you remove "" filenames with spaces in them will fail
2. I merge all CSV into one CSV:
After that, you can edit it however you like it.
Since I didn't find a way to export 2nd, 3rd, 4th... sheet, you must have that sheet as 1st in your document.
Hope it helps someone. Thank you for help.