CSV to Json

This topic contains 4 replies, has 2 voices, and was last updated by  Powersheller 1 year, 1 month ago.

  • Author
  • #69333


    i have an excel file with 2 columns and multiple rows in it, i saved it as csv file using excel save as option, i imported that csv file using import-csv and stored it in a variable , when i try to convert that to json using convertto-json, it keeps throwing the error "ConvertTo-Json : The converted JSON string is in bad format."
    But when i convert it with -compress , it works but it looks ugly and not usable for me. Any help? is there a way to construct a json file from csv using the values stored in variable or is there a way to decompress the compressed json file to make it work

  • #69336

    Do you have headers in csv file? Do you specify delimiter when importing csv?

    • #69340


      yes i have headers and even if i specify delimiters it does not work 🙁

  • #69343

    Can you show your csv file?

  • #69346


    it has some values in it, if i edit those, excel restarts automatically 😮

You must be logged in to reply to this topic.