Page 1 of 1

comma delimited to single column

Posted: Tue Sep 14, 2004 11:33 pm
by rfigley
I've got a file of email addresses that was exported from and AOL address book. all the email addresses are separted by a comma and a space. I want to convert it to a single column (each email address seperated by carriage return. What is the easiest way to do this?

Posted: Tue Sep 14, 2004 11:50 pm
by ol4pr0
preg_replace

or just use some editor hehe.. that will put a->B

Posted: Wed Sep 15, 2004 12:12 am
by feyd
heck, [php_man]str_replace[/php_man]() can easily do this..

Posted: Wed Sep 15, 2004 1:48 am
by m3mn0n
Yep.

[php_man]explode[/php_man](), [php_man]str_replace[/php_man](), and [php_man]foreach[/php_man]() to be exact. :wink:

Posted: Wed Sep 15, 2004 6:41 am
by rfigley
OK actually. This conversion is for a text file to be imported into an bulkd emailer program. I have the text file (comma and space delimited) that I want to replace the comma space with a carriage return. It not for a php application. I gues you'd say I wnat to convert it from ", " delimited to "Carriage return" or "next line" delimited without doing it manually. Like a search and replace. The problem is doing a search and replace using ASCII code.

Posted: Wed Sep 15, 2004 6:54 am
by feyd
our answers cover those.