Created
September 25, 2024 07:40
-
-
Save kiang/e04ed89fb4036ae994df96b2b5af383d to your computer and use it in GitHub Desktop.
a simple script to parse csv data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fh = fopen(__DIR__ . '/map.csv', 'r'); | |
$oFh = fopen(__DIR__ . '/result.csv', 'w'); | |
fputcsv($oFh, ['編號', '行政區', '照片', '看板位置']); | |
fgetcsv($fh); | |
while ($line = fgetcsv($fh)) { | |
fputcsv($oFh, [$line[7], $line[4], $line[1], "https://www.google.com/maps?q={$line[6]},{$line[5]}"]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment