Convert CSV sheet to Json

Hi

How can I convert my CSV sheet to JSON sheet.

I’m getting while convert my CSV sheet into JSON

Here is the workflow

Regards
Naman

1 Like

Hi @Naman_Arora

Check out the below thread

Regards

Hey @Naman_Arora
Here you can find example workflow with conversion csv to json:
BlankProcess93.zip (3.4 KB)
image

@pikorpa Hi

Is there any possible to way to only read cell “K2” value and writes it’s value in JSON.

I tried with output data table but it’s still giving me errors.

Regards
Naman

Hi @Naman_Arora

Read CSV (Output: csvData)
Assign(cellValue = csvData.Rows(1)(10).ToString)
Assign(jsonContent = "{ ""k2Value"": """ + cellValue + """ }")
Write Text File (Text: jsonContent)

Hope it helps!!

@Naman_Arora
you can try to use vb code:

Dim columnName As String = "YourColumnNameK" 
Dim cellValue As String = dtCSV.Rows(1)(columnName).ToString().Trim().Replace("""", "\""") 

jsonString  = $"[{{""{columnName}"": ""{cellValue}""}}]"

@Naman_Arora, try
Newtonsoft.Json.JsonConvert.SerializeObject(Datatable)