Mickael:
On Fri, Jul 15, 2016 at 4:03 AM, <mickael.kerjean@gmail.com> wrote:
> I'm having some bad time inserting data in a csv format coming from:
> https://www.maxmind.com/en/free-world-cities-database
I've downloaded it, it is NOT in CSV format, CSV means more than commas.
I've checked it does not need scaping by doing:
$ perl -ne '@x=split/,/,$_; 7==@x or print "$.-$_";'
~/Downloads/worldcitiespop.txt | head
And not getting any output, and checked it does not have backslashes by doing
$ fgrep -c '\' ~/Downloads/worldcitiespop.txt
0
So you could probably load it by NOT using CSV ( as the .txt extension
hints ), that is use FORMAT text ( the default ) and DELIMITER ',' and
it will probably get in fine ( try some variations if not ).
> I tried to import this file using excel and everything was working as
> expected
Excel lies. A lot. Maybe with good intention, but it does many things
behind the scenes, like parsing non-csv data right when told to read
CSV.
Also, CSV is a very ill defined format, I've been unable to use it
properly since the Multiplan days, specially since they started
putting L10N/I18N in it.
Francisco Olarte.