In USQL I am reading csv file. It is telemetry data, so csv file may have any bad data. I am reading that csv file and creating JObject in USQL. I want to replace invalid characters from all values of json objects, so that my script will not fail because of bad data. I want to generate json output.
I am thinking to replace "\\"
and "\""
with blank before creating JObject
. Please let me know whether this is correct way to remove bad data. If anyone has better solution, let me know. Also apart from "\" and "\"" do I need to remove any other characters. My Usql code is mentioned below -
@Data=
SELECT new JObject(
new JProperty("Name", Name),
new JProperty("Description", Description)
).ToString() AS Document
FROM @InputData;