Created
November 22, 2019 18:42
-
-
Save andydempster/a203234d2470963d36b923f7e6cceda9 to your computer and use it in GitHub Desktop.
Find and Replace in a CSV
This file contains 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 | |
require_once('countries.php'); | |
$row = 0; | |
$fp = fopen('hubspot10daysnew.csv', 'w'); | |
$countries = get_countries(); | |
if (($handle = fopen("hubspot10days.csv", "r")) !== FALSE) { | |
while ($data = fgetcsv($handle)) { | |
$data[4] = get_country($data[4]); | |
fputcsv($fp, $data); | |
echo "Processed line ".$row++."\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment