02-05-2020 02:47 AM
Team,
I have a log file in csv format. But the log file contains status information in first 5 lines and last 3 lines.
I can skip the first 5 lines using Skip lines* property in csv parser. But I could not remove the last 3 lines.
And I am getting error in csv parser because of this.
2020-02-04 21:49:01 STATUS: Task started
2020-02-04 21:49:01 STATUS: Connection established
2020-02-04 21:49:13 STATUS: Executing records…
START RECORD BLOCK
“Column1”,“Column2”,“Column3”,“Column4”,“Column5”
Value1,Value2,Value3,Value4,Value5
Value10,Value20,Value30,Value40,Value50
Value100,Value200,Value300,Value400,Value500
END RECORD BLOCK
Thanks,
Dhivya.
Solved! Go to Solution.
06-26-2020 08:29 AM
Hi,
I tried to recreate the error by parsing the data from the original post, and yes, the CSV Parser threw an error. Still, the desired data from the .csv file were present on the output of the CSV Parser Snap, correctly transformed into JSON format. I too skipped the first 5 lines by using the “Skip lines” property in the CSV Parser.
However, by selecting the “discard error data and continue” option in the drop-down for the Error View in the CSV Parser, the problem disappeared altogether. No error, and the CSV data was correctly parsed.
BR,
Dimitri
02-05-2020 02:48 AM
I need to remove this part which is at the bottom of the log file.
**END RECORD BLOCK**
- Task completed successfully
06-25-2020 03:38 PM
Hi were you able to find a solution for this?
06-26-2020 08:29 AM
Hi,
I tried to recreate the error by parsing the data from the original post, and yes, the CSV Parser threw an error. Still, the desired data from the .csv file were present on the output of the CSV Parser Snap, correctly transformed into JSON format. I too skipped the first 5 lines by using the “Skip lines” property in the CSV Parser.
However, by selecting the “discard error data and continue” option in the drop-down for the Error View in the CSV Parser, the problem disappeared altogether. No error, and the CSV data was correctly parsed.
BR,
Dimitri
06-28-2020 10:31 PM
Thank you Dimitri. This solution, i.e., selecting the "discard error data and continue” option in the drop-down for the Error View, helped.
Regards,
Dhivya.