Skip to content

E. Export Basetation to csv for \db\ direcotory

Al Kissack edited this page Jul 12, 2018 · 2 revisions

This is the script I use to extract the relevant data from my basestation-like mySQL daabse. I then use the output to generate the contents of the /db/ directory (https://github.com/alkissack/Dump1090-OpenLayers3-html/wiki/F.-%5Cdb%5C):

SELECT ModeS, IFNULL(Registration,''), IFNULL(ICAOTypeCode,''), IFNULL(Type,''), IFNULL(ModeSCountry,''), IFNULL(UserBool1,''), IFNULL(UserString1,''), IFNULL(UserString2,''), IFNULL(UserString3,''), IFNULL(UserInt1,'') ,IFNULL(OperatorFlagCode,'') FROM Aircraft INTO OUTFILE '/tmp/data1.csv' FIELDS ENCLOSED BY '"' TERMINATED BY ',' ESCAPED BY '"' LINES TERMINATED BY '\r\n';