From 959c33634cf13cd1e9fd1cde7f81d6423c01e929 Mon Sep 17 00:00:00 2001 From: Ludovic Launer Date: Mon, 15 Apr 2024 13:09:48 +0200 Subject: [PATCH] Change AERIAL_SPORTING_RECREATIONAL to ASR and UNCLASSIFIED to AWY --- .vscode/launch.json | 17 +++++++++++++ france.txt | 58 ++++++++++++++++++++++----------------------- src/findLines.js | 24 +++++++++++++++++++ 3 files changed, 70 insertions(+), 29 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 src/findLines.js diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..bf65f0e --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Launch Program", + "skipFiles": [ + "/**" + ], + "program": "${workspaceFolder}\\src\\findLines.js" + } + ] +} \ No newline at end of file diff --git a/france.txt b/france.txt index bef2369..f2c7458 100644 --- a/france.txt +++ b/france.txt @@ -21609,7 +21609,7 @@ DP 43:55:30 N 005:38:38 E ** 200 Para LILLE MARCQ ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para Lille Marcq 122,000 AH FL140 AL GND @@ -21619,7 +21619,7 @@ DC 1 ** 203 Para LA FLECHE ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para La Fleche 123,5 ou Nantes Info AH FL115 AL GND @@ -21629,7 +21629,7 @@ DC 1 ** 208 Para FRETOY LE CHATEAU** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para Fretois le Chateau AH FL135 AL GND @@ -21639,7 +21639,7 @@ DC 1 ** 217 Para NEUVY LE ROI ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para Neuvy le Roi Tours Info 121,0 AH FL105 AL GND @@ -21649,7 +21649,7 @@ DC 1 ** Para 226 PERONNE** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para Peronne 129,800 AH FL135 AL GND @@ -21659,7 +21659,7 @@ DC 1 ** Para 228 CHARLEVILLE** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para Charleville 126,850 AH FL150 AL GND @@ -21669,7 +21669,7 @@ DC 1 ** 237 Para MAGNY COURS ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para Magny Cours Nevers Info 120.6 AH FL140 AL GND @@ -21680,7 +21680,7 @@ DC 1 ** Para 241 MERVILLE** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para Merville 119,075 AH FL140 AL GND @@ -21690,7 +21690,7 @@ DC 1 ** Para 271 MAUBEUGE** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para Maubeuge 121,000 AH FL140 AL GND @@ -21700,7 +21700,7 @@ DC 1 ** 301 Para LASCLAVERIES ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para 301 Pyr n es APP 128.8 AH FL140 AL GND @@ -21711,7 +21711,7 @@ DC 1 ** 302 Para HANDIA ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para Handia Biarritz 125,6 AH FL115 AL GND @@ -21721,7 +21721,7 @@ DC 1 ** 304 Para BOULOC ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN ParaBouloc 123.35 AH FL115 AL GND @@ -21732,7 +21732,7 @@ DC 1 ** 378 Para LA REOLE ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para La Reole 123.35 AH FL135 AL GND @@ -21743,7 +21743,7 @@ DC 1 ** 381 Para MONTPEZAT ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para AH FL040 AL GND @@ -21753,7 +21753,7 @@ DC 0.76 ** 391 Para CAHORS ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para Cahors 119.225 & 133.725 >FL115 121.250 AH FL140 AL GND @@ -21764,7 +21764,7 @@ DC 2 ** 402 Para AVIGNON PUJAUT ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para 402 AH FL135 AL GND @@ -21774,7 +21774,7 @@ DC 1 ** 403 LE LUC ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para LeLUC 123.0 (SDJF) AH FL130 AL GND @@ -21785,7 +21785,7 @@ DC 1 ** 417 Para CHAMBERY ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para 417 Chambery Info 123.7 ou Lyon St Ex APP 120.225 AH FL140 AL GND @@ -21796,7 +21796,7 @@ DC 1 ** 422 Para AMBERIEU ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para 422 129.75 ou Lyon St Ex APP 120.225 AH FL85 AL GND @@ -21808,7 +21808,7 @@ DC 1 ** 436 Para GAP ** ** Ref : Carte VAC + Note technique FFPS - 15.05.2004 ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN ParaGap Notam AH FL195 AL FL155 @@ -21817,7 +21817,7 @@ DC 2 AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para Gap 119.1 AH FL155 AL 5300FT MSL @@ -21827,7 +21827,7 @@ DC 2 AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para Gap 119.1 AH 5300FT MSL AL GND @@ -21842,7 +21842,7 @@ DP 44:25:32 N 006:00:59 E ** 445 Para PUYRICARD ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para Puyricard Marseille Info 120.55 AH FL140 AL GND @@ -21853,7 +21853,7 @@ DC 1 ** 510 Para ARON Lieu dit AEROFERME ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Para Les Ecottays ULM (SDJF) AH 4500FT MSL AL GND @@ -21863,7 +21863,7 @@ DC 1 ** Voltige n:6920 ST AUBAN ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Voltige 122.3 AH FL075 AL 850FT AGL @@ -21874,7 +21874,7 @@ DC 0.5 ** Voltige n:6951 VINON ** AC UNCLASSIFIED -AY AERIAL_SPORTING_RECREATIONAL +AY ASR AN Voltige 118.15 AH 5906FT AGL AL 2000FT AGL @@ -30156,7 +30156,7 @@ DP 46:15:27 N 006:51:16 E ** AWY A29 GIROM-ASPET (21 MAR 2002) ** AC D -AY UNCLASSIFIED +AY AY AN AWY A29 AH FL295 AL FL115 @@ -30180,7 +30180,7 @@ DP 42:49:00 N 000:53:00 E ** Airways (AWY) FL115 Max ** AC D -AY UNCLASSIFIED +AY AWY AN FL115 Max AH FL195 AL FL115 @@ -30201,7 +30201,7 @@ DP 44:35:31 N 005:01:24 E ** AWY B31 TMA TLS-PUMAL (21 MAR 2002) ** AC D -AY UNCLASSIFIED +AY AWY AN AWY B31 AH FL295 AL FL115 diff --git a/src/findLines.js b/src/findLines.js new file mode 100644 index 0000000..f2bbcbe --- /dev/null +++ b/src/findLines.js @@ -0,0 +1,24 @@ +const fs = require('fs'); +const readline = require('readline'); + +const findLinesStartingWith = async (filePath, startWord) => { + const fileStream = fs.createReadStream(filePath); + + const rl = readline.createInterface({ + input: fileStream, + crlfDelay: Infinity + }); + + const lines = []; + + for await (const line of rl) { + if (line.startsWith(startWord) && !lines.includes(line)) { + lines.push(line); + } + } + + return lines; +}; + +var lines = findLinesStartingWith('france.txt', 'AY').then(lines => console.log(lines)); +console.log(lines); \ No newline at end of file