Safest Way to Convert Hundreds of *.xls to *.ods

Page 2 of 3 FirstFirst 123 LastLast

  1. Posts : 148
    Win 10 Pro - 1903
    Thread Starter
       #11

    sbh7600 said:
    Here is how :


    Lets say you have your files in D:\backup\documents then navigate to ii in CMD

    Then you have to do:

    Code:
    for%%f in (*.xls) do"c:\program files\openoffice\soffice.exe" --convert-to ods "%%f"
    Make sense now ?
    Maybe it does make sense, but it does not work.
    I moved the first 36 files into a directory I named Fiddle on c:\
    Then navigated to that directory via Elevated Command and copied the code from above post and hit Enter...and got the message you see below in bold face:

    (c) 2019 Microsoft Corporation. All rights reserved.

    C:\WINDOWS\system32>cd\

    C:\>cd fiddle

    C:\Fiddle>for%%f in(*.xls)do"c:Program Files\libreoffice\program\soffice.exe"--convert-to ods "%%f"
    'for%%f' is not recognized as an internal or external command,
    operable program or batch file.

    C:\Fiddle>

    -----NOTE: I use LibreOffice, not OpenOffice-----

    I realize that I'm doing something wrong. But what do I have to do differently? Thanks for sticking with me.
      My Computers


  2. Posts : 8,696
    Mac OS Catalina
       #12

    You keep leaving the space out between for and %%f. You must enter the script as it is shown and with the spaces in the proper places.
      My Computer


  3. Posts : 12,482
    Win10 Version 21H2 Pro and Home, Win11 Pro
       #13

    From the first response to the question:
    for %%f in (*.xls) do "path_to_libreoffice\soffice.exe" --convert-to ods "%%f"
      My Computers


  4. Posts : 8,696
    Mac OS Catalina
       #14

    Post a list of the directories and someone can help you in how to build a script that includes an output of the number of files that are converted and those that could not.
      My Computer


  5. Posts : 148
    Win 10 Pro - 1903
    Thread Starter
       #15

    bro67 said:
    Post a list of the directories and someone can help you in how to build a script that includes an output of the number of files that are converted and those that could not.
    Great Idea!

    To make it simple, just use the one directory. I'll copy files into it, then after they're converted I'll move them where they belong. Thanks a bunch.

    - - - Updated - - -

    bro67 said:
    You keep leaving the space out between for and %%f. You must enter the script as it is shown and with the spaces in the proper places.
    Here's what happened:

    C:\Fiddle>for %%f in (*.xls) do "c:Program Files\libreoffice\soffice.exe" --convert-to ods "%%f
    %%f was unexpected at this time.

    C:\Fiddle>
      My Computers


  6. Posts : 12,482
    Win10 Version 21H2 Pro and Home, Win11 Pro
       #16

    I think in the section "c:Program Files\libreoffice\soffice.exe" a backslash \ is missing after the c:.
      My Computers


  7. Posts : 148
    Win 10 Pro - 1903
    Thread Starter
       #17

    Berton said:
    I think in the section "c:Program Files\libreoffice\soffice.exe" a backslash \ is missing after the c:.
    Ooh...I'll bet you're right! I'll try it once more later when I get back to the desktop. Thanks!

    - - - Updated - - -

    Berton...

    Well, I tried.

    Discovered that on this computer, not on others, Libre installed soffice.exe in a subdir called program.

    Here's the result (bold face is the error message):

    Microsoft Windows [Version 10.0.18362.295]
    (c) 2019 Microsoft Corporation. All rights reserved.

    C:\WINDOWS\system32>cd\

    C:\>cd fiddle

    C:\Fiddle>for %%f in (*.xls) do "c:\Program Files\libreoffice\program\soffice.exe" --convert-to ods "%%f"
    %%f was unexpected at this time.

    C:\Fiddle>

    BTW...will this same procedure change *.xlsx to *.ods
      My Computers


  8. Posts : 12,482
    Win10 Version 21H2 Pro and Home, Win11 Pro
       #18

    BTW...will this same procedure change *.xlsx to *.ods
    It might since LibreOffice can work with/open the newer .xlsx format.
      My Computers


  9. Posts : 148
    Win 10 Pro - 1903
    Thread Starter
       #19

    Berton, bro67, sbh7600...Thank you all for trying to get through my dense skull. My problem is...

    This command is not working. I've tried it on 2 Win-10 computers via Elevated Command. Fiddle is the dir into which I copied the files I wish to convert from XLS and XLSX to ODS.

    C:\WINDOWS\system32>cd\

    C:\>cd fiddle

    C:\Fiddle>for %%f in (*.xls) do "c:\Program Files\libreoffice\program\soffice.exe" --convert-to ods "%%f"
    %%f was unexpected at this time.

    If I've typed the above command incorrectly, Please copy-edit-paste a corrected version so I can copy-paste and try it again. (Maybe if I eliminate my typing and just copy and paste your edited version, things will go right.)

    The bold red text above is the error message I received, so I must be doing something wrong. I appreciate your help and look forward to any new guidelines on this.
      My Computers


  10. Posts : 8,696
    Mac OS Catalina
       #20

    You need \\ after c: or it is not going to work.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 12:05.
Find Us




Windows 10 Forums