There is a data dump that is semi colon separated.
How to load that data to the Postgres SQL database?
City;Latitude;Longitude
London;51.50;0.12
Paris;48.85;2.35
I thought of preparing an insert statements from this data using Atom text editor. But there comes another challenge the first semi-colon needs to be substituted with a single quote and a comma to make a valid insert statement.
DDL for the table:
create table cities (
name varchar(100),
Latitude float,
Longitude float
);
The insert statement should look like this:
insert into cities values('London',51.50,0.12);
insert into cities values('Paris',48.85,2.35);
But I was able to generate only this by using atom text editor:
insert into cities values('London,51.50,0.12);
insert into cities values('Paris,48.85,2.35);
The above is achieved by replacing semi colon with comma. Using ^ to add insert into cities values(' in the beginning and $ to add ); in the add.
So the question is, what should be the regular expression to be used with atom text editor to replace the first occurrence of the semi colon?