How to handle multi-line values in CSVs #2729
-
|
Describe the bug To Reproduce Create a file Run and get this error: When I run
No idea what that error is Expected behavior Screenshots/Backtrace/Sample Data Desktop (please complete the following information):
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
I think there are two issues here.
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the detailed report @alexkreidler . To handle embedded XML values like this - you need to escape them by using double quotes around the entire field and escape any double quotes within the field by doubling them: id,date_created,date_modified,judges,date_filed,date_filed_is_approximate,slug,case_name_short,case_name,case_name_full,scdb_id,scdb_decision_direction,scdb_votes_majority,scdb_votes_minority,source,procedural_history,attorneys,nature_of_suit,posture,syllabus,headnotes,summary,disposition,history,other_dates,cross_reference,correction,citation_count,precedential_status,date_blocked,blocked,filepath_json_harvard,filepath_pdf_harvard,docket_id,arguments,headmatter
"1553297","2014-10-30 18:18:48.065126+00","2024-11-02 17:57:19.548229+00","Cecelia H. Goetz","1985-10-29","f","ambico-inc-v-aic-photo-inc-in-re-aic-photo-inc","In re AIC","Ambico, Inc. v. AIC Photo, Inc. (In Re AIC Photo, Inc.)","In the Matter of AIC PHOTO, INC., Et Al., Debtor. AMBICO, INC., Plaintiff, v. AIC PHOTO, INC., Defendant","",,,,"LU","","Patterson, Belknap, Webb & Tyler, New York City by Scott Horton, for debtors., Windels, Marx, Davies & Ives, New York City by Christopher T. Ragucci, for Ambi-co., Zalkin, Rodin & Goodman, New York City by Andrew D. Gottfried, for Manufacturers Hanover Trust.","","","","","","","","","","","5","Published",,"f","law.free.cap.br.57/56.6097565.json","harvard_pdf/1553297.pdf","1638530","","""<parties id=""b112-20"">
In the Matter of AIC PHOTO, INC., et al., Debtor. AMBICO, INC., Plaintiff, v. AIC PHOTO, INC., Defendant.
</parties><docketnumber id=""Ag36"">
Bankruptcy No. 185-50388-21.
</docketnumber><docketnumber id=""Aif"">
Adv. No. 185-0055.
</docketnumber><court id=""ABf"">
United States Bankruptcy Court, E.D. New York.
</court><decisiondate id=""AE5"">
Oct. 29, 1985.
</decisiondate><br><attorneys id=""b113-8"">
<span citation-index=""1"" class=""star-pagination"" label=""57"">
*57
</span>
Patterson, Belknap, Webb & Tyler, New York City by Scott Horton, for debtors.
</attorneys><br><attorneys id=""b113-9"">
Windels, Marx, Davies & Ives, New York City by Christopher T. Ragucci, for Ambi-co.
</attorneys><br><attorneys id=""b113-10"">
Zalkin, Rodin & Goodman, New York City by Andrew D. Gottfried, for Manufacturers Hanover Trust.
</attorneys>"""
"10154826","2024-10-22 16:55:01.985413+00","2024-10-22 16:55:02.172053+00","","2008-01-10","f","state-v-woods","Woods","State v. Woods","","",,,,"C","","","","","","","","","","","","","0","Unpublished","2024-10-22","t","","","69293379","",""
"10154827","2024-10-22 16:55:02.320424+00","2024-10-22 16:55:02.457429+00","","2008-01-10","f","state-v-weathersbee","Weathersbee","State v. Weathersbee","","",,,,"C","","","","","","","","","","","","","0","Unpublished","2024-10-22","t","","","69293380","",""
"10154828","2024-10-22 16:55:02.684449+00","2024-10-22 16:55:02.816383+00","","2008-01-10","f","state-v-walker","Walker","State v. Walker","","",,,,"C","","","","","","","","","","","","","0","Unpublished","2024-10-22","t","","","69293381","",""Doing so allows the other commands in your example to work. BTW, I'll convert this issue to a Discussion so other folks with a similar problem can find it. |
Beta Was this translation helpful? Give feedback.
I think there are two issues here.
""rather than\". Starting your pipeline withqsv input --escape '\' simple.csvfixes all of your problematic examples.SIGSEGVand my "program never terminates" points to some state withinqsvthat needs attention.