Parse csv file that have a json column

#1

Hello, everyone,

Infrastructure_monitor.zip (386 Bytes)

I have a csv file and some columns in the attached file that have a json notation.

I need to read this CSV file with a CSV Reader node, and use the node String to Json to get the JSON column. But I always get the following error:

ERROR String to JSON 0:384 Execute failed: Unexpected character (‘a’ (code 97)): was expecting double-quote to start field name at [Source: java.io.StringReader@412ba3; line: 1, column: 3] (edited)

Anyone can help please?

0 Likes

#2

Hi there @Peter29 ,

replace ' with " in String Manipulation node prior too String to JSON node.

replace($metadata$,"'" ,"\"" )

Br,
Ivan

0 Likes

#3

Many thanks for your help ipazin. Worked :slight_smile:

1 Like

#4

Hi there @Peter29,

glad it helped :wink:

Br,
Ivan

0 Likes