News for hackers. Stuff that matters.
Re:Health insurers just published close to a trillion hospit... by nardi on Tuesday September 06, 2022 @11:31PM (#32746047)
Do NOT read a CSV file by splitting on commas. Python has a perfect CSV library built right in: https://docs.python.org/3/library/csv.html.

If you split on commas, your code will fail for quoted fields with commas in them.

Re:Health insurers just published close to a trillion hospit... by orangepurple on Wednesday September 07, 2022 @01:47AM (#32746819)
This is obviously a quick and dirty hack. It only splits the header by commas. Postgres has its own read in logic you can adjust by passing arguments to \copy or copy. If you have anything more complex you need to handle it by parsing the header more intelligently than splitting on commas and adding appropriate arguments to copy or \copy