I have been working with a script to change my CSV file to Tab Delimited. It seems to work great, but it is read-only. How do I go about actually writing the changes to the file? Here is the script:
<?php
$myfile = "/path/to/my.csv";
$csv_fp = fopen ($myfile, "r");
$rows = 0;
while ($data = fGetCsv ($csv_fp, 10000, ","))
{
$num = count($data);
for ($c=0; $c < $num; $c++) {
echo $data[$c] . "<br />\n";
}
$rows++;
}fclose ($csv_fp);
?>
This is how you can change a comma delimited CSV to a tab delimited. However, I don’t see the benefits of doing this. I think comma delimited CSVs are much less prone to errors.