I've never really done much with parsing text in PHP (or any language). I've got this text:
1 (2) ,Yes,5823,"Some Name
801-555-5555",EXEC,,"Mar 16, 2009",0.00,
1 (3) ,,4821,Somebody Else,MBR,,"Mar 11, 2009",,0.00
2 (1) ,,5634,Another Guy,ASSOC,,"Mar 15, 2009",,0.00
You can see the first line has a break, I need to get it be:
1 (2) ,Yes,5823,"Some Name 801-555-5555",EXEC,,"Mar 16, 2009",0.00,
1 (3) ,,4821,Somebody Else,MBR,,"Mar 11, 2009",,0.00
2 (1) ,,5634,Another Guy,ASSOC,,"Mar 15, 2009",,0.00
I was thinking of using a regular expression to find \n
within quotes, (or after a quote, since that wouldn't create false matches) and then replacing it with nothing using PHP's preg_replace()
. I'm currently researching regex since I don't know any of it so I may figure this out on my own (that's always best) but no doubt a solution to a current problem of mine will help me get a handle on it ever sooner.
Thanks so much. If I could, I'd drop a bounty on this immediately.
Thanks!