-
Notifications
You must be signed in to change notification settings - Fork 0
-
Hi,
In the ipverse/asn-info repo the CSV currently uses comma (,) as a column separator.
This creates a problem in some lines in the description column, as it contains commas.
Why not use a semicolon as a column separator?
Beta Was this translation helpful? Give feedback.
All reactions
While the bug was fixed in August, existing database entries were not migrated. This has now been corrected. Thanks for the heads-up.
Replies: 5 comments 1 reply
-
Hi, thanks for pointing this out.
The use of a comma as the separator is intentional and mainly historical. This file follows the same format as other established ASN/IP lists, and keeping it identical allows it to be used as a drop-in replacement without requiring changes on the consumer side.
Descriptions containing commas are therefore not expected and should be treated as data issues. I’m happy to fix those, but I’ll need concrete examples.
Could you please point me to the specific entries or line numbers where this causes problems?
Thanks for the feedback.
Beta Was this translation helpful? Give feedback.
All reactions
-
Importing the CSV file to SQLite will throws the error/warning "expected 3 columns but found 4 - extras ignored" and report the lines.
e.g.: sqlite3 as.db -cmd ".import --csv --skip 1 as.csv asn_info" '';
lines.txt: https://gist.github.com/nfcg/703a99659833bd22d974465a9567e0a6 (--skip 1)
I am currently using this command:
sed -E 's/^([^,]+),([^,]+),(.*)$/1,円2,円"3円"/' as.csv > as_fixed.csv
which adds (") to the data in the description column and solving the issue this way....
Beta Was this translation helpful? Give feedback.
All reactions
-
I can't help you with that import but regarding the comma, a quick csvtool col 3 as.csv | grep ',' doesn't show any.
Beta Was this translation helpful? Give feedback.
All reactions
-
That actually was a dumb test, let me have a look at it again.
Beta Was this translation helpful? Give feedback.
All reactions
-
While the bug was fixed in August, existing database entries were not migrated. This has now been corrected. Thanks for the heads-up.
Beta Was this translation helpful? Give feedback.
All reactions
-
Btw. the list gets exported to JSON too now if you don't like (faulty) CSV's.
Beta Was this translation helpful? Give feedback.