Jul 9, 2001, 1:20 PM
Post #2 of 3
Re: regex to add pipe delimiter?
[In reply to]
if you put the line into $line, you can use the following code:
This will split $line into four parts at spaces, join the four parts with a pipe and finally append a pipe to the end. So
$line = join('|', split ' ', $line, 4) . '|';
will turn to
"January 01 1883 Firm named Emery Brothers established"
Hope this helps.
"January|01|1883|Firm named Emery Brothers established|"