I have a CSV file in which I need to replace some text. In column 1 I have the old phrase (of which I need to replace part of it with column 3). Column 2 is not required.
So for example here is row 1 (I have also added column 1,2,3 above each column)
$language['admin_index_page_title'] = "Welcome to Admin";
Welcome to Admin.
Админд тавтай морилно уу.
Now what I need to do is replace the text within double quotes from column 1 with the text in column 3. So column 1 will end up like this:
$language['admin_index_page_title'] = "Админд тавтай морилно уу.";
Any ideas how to do this?
(COMPLETELY untested. Test before writing back to the file. I'm assuming your fields are not quote-encapsulated, are seperated by commas, and lines are delimited by newline)
Why not just reassign the column in the row?
$row = $row;
It's not replacing the value entirely, Anthony, he wants to slice it into the space between the quotes.... essentially the CSV file is a massive Find/Replace (Needle = Row, Replace = Row, Haystack = Row)
Ah, got you. Thanks StarLion.
This topic is now closed. New replies are no longer allowed.