Author Posts

April 24, 2017 at 11:17 am

Hello,
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

April 24, 2017 at 11:36 am

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

April 24, 2017 at 11:42 am

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

April 24, 2017 at 11:44 am

Can you show your csv file?

April 24, 2017 at 12:03 pm

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