Forum Discussion
Hi @bepelletier,
I tried to recreate the error you are getting by going on the path with the File Reader Snap, and yes, I got the same error message.
So it occurred to me to implement a workaround, and it appears to be functioning. Please find my solution in the attached pipeline.
The solution consists of using a REST Get Snap to make a call to http://api.pluralsight.com/api-v0.9/courses. The REST Get Snap will throw an error because, naturally, it tries to parse the $content field of the response as JSON, but the value of that field is CSV encoded data. Regardless, in the Mapper Snap connected to the error view of the REST Get Snap I map the necessary fields in order to write the $content (the actual CSV encoded data we want) to sldb with the use of a File Writer. After that I proceed to read the file from sldb as usual.
I hope this solution can be useful to you, in you particular circumstances. If you have any questions I’d be happy to help you further.
BR,
Dimitri
Read_HTTP_File_In_CSV_Format_2020_04_16.slp (15.2 KB)
P.S. : I should warn you that, at least in my case, when I try to preview the data at the error view of the REST Get Snap, the page in my browser tends to freeze. I guess that’s because the value of the $content is rather large, the file being 8+ MB in size.
That’s clever! It’s kind of weird to start a pipeline getting good data from an error. My mind is not set for this kind of thing. But it is definitely working.
I thank you very much Dimitri.
- Aleksandar_A2 years agoContributor III
Hello SL12345,
Please refer to the attached sample pipeline, and let me know if this helps you!
Regards,
Aleksandar.
- SL123452 years agoNew Contributor III
Looks good but question .... in my example - one row has more fields than another row
Is it possible to "connect"/export two lines into one file but without empty field at the and of shorter row?
(Mercedes is shorter and CSV formatter creates last empty field) instead of this:
"Mercedes";"6658";"TypeS";"2022";""
"Audi";"5558";"TypeA8";"2022";"Diesel"get This
"Mercedes";"6658";"TypeS";"2022";
"Audi";"5558";"TypeA8";"2022";"Diesel"Thank you
- Aleksandar_A2 years agoContributor III
Try with this one.
Related Content
- 11 months ago
- 3 months ago
- 5 years ago
- 8 years ago
- 2 years ago