ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Bash Script to Convert .csv to .xlsx

    IT Discussion
    4
    9
    8.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • LakshmanaL
      Lakshmana
      last edited by

      Can anyone help me with the bash script things to be used for the conversion of .csv to .xlsx files ?

      Having the .csv files in one folder that have to be converted into .xlsx files

      1 Reply Last reply Reply Quote 1
      • scottalanmillerS
        scottalanmiller
        last edited by

        I don't think that that is an easy conversion at all, and BASH would not likely be the language to use for that. XSLX is a complicated format that does a lot that CSV does not. There is a reason that tools for this conversion process are sold, it's non-trivial.

        1 Reply Last reply Reply Quote 1
        • IRJI
          IRJ
          last edited by

          https://social.technet.microsoft.com/Forums/windowsserver/en-US/370ee470-f2cd-4f30-a167-b106dd51d47a/powershell-convert-csv-to-xlsx?forum=winserverpowershell

          1 Reply Last reply Reply Quote 0
          • LakshmanaL
            Lakshmana
            last edited by Lakshmana

            I am in need for the Linux or for Mac with the help of Python if it is possible !!!

            1 Reply Last reply Reply Quote 0
            • A
              aidan_walsh
              last edited by aidan_walsh

              Maybe something using LibreOffices --convert-to command line option? For example:

               soffice --convert-to xlsx:"Calc MS Excel 2007 XML" filename.csv --headless
              

              Edit: Edited to change reference from Excel 2003 to 2007.

              1 Reply Last reply Reply Quote 5
              • LakshmanaL
                Lakshmana
                last edited by

                move command helps ?

                scottalanmillerS 1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller @Lakshmana
                  last edited by

                  @lakshmana said in Bash Script to Convert .csv to .xlsx:

                  move command helps ?

                  Not sure what you mean. But a move mv command will not be useful here.

                  LakshmanaL 1 Reply Last reply Reply Quote 0
                  • LakshmanaL
                    Lakshmana @scottalanmiller
                    last edited by

                    @scottalanmiller mv test.csv test.xlsx will helps to convert the .csv files?

                    scottalanmillerS 1 Reply Last reply Reply Quote 0
                    • scottalanmillerS
                      scottalanmiller @Lakshmana
                      last edited by

                      @lakshmana said in Bash Script to Convert .csv to .xlsx:

                      @scottalanmiller mv test.csv test.xlsx will helps to convert the .csv files?

                      No, simply renaming a file won't convert it, it's just renaming it. On Linux, the file extension doesn't even tell us the intent of a file, let alone alter the file itself.

                      1 Reply Last reply Reply Quote 1
                      • 1 / 1
                      • First post
                        Last post