I would do it in three steps.

Search for ^(sun .*)$ replace with \1^
Search for \r replace with \t
Search for ^\t replace with \r

Thanks,
Ted
***********************  Ted Burger  ****************************
[email protected]      *********     www.tobsupport.com



On Mar 2, 2014, at 11:07 AM, BeeRich wrote:

> Hi folks.  I have a challenge for the BBEdit peeps out there.  
> 
> I have a PDF that has a chart in it.  I want to turn it into some real data 
> as the pdf is pretty much useless to me.  Upon copying a page of cells, I 
> want to parse that into tab delimited text in BBEdit, but the cells wrap and 
> I have a list of values instead.  Here's a chunk:
> 
> Airdrie
> 7254
> AIRDRIE
> 2925 Main Street West
> (403) 945-3865
> M-F 7AM-10PM
> SAT 7AM-9PM
> SUN 8AM-8PM
> Calgary
> 7250
> CALGARY (TUSCANY)
> 5019 Nose Hill Drive N. W.
> (403) 241-4060
> M-F 7AM-10PM
> SAT 7AM-9PM
> SUN 8AM-8PM
> Calgary
> 7076
> CALGARY BEACON HILL
> 11320 Sarcee Trail NW
> (403) 374-3860
> M-F 7AM-10PM
> SAT 7AM-9PM
> SUN 8AM-8PM
> Sherwood Park
> 7172
> SHERWOOD PARK
> 200, 390 Baseline Rd.
> (780) 417-7875
> M-F 7AM-10PM
> SAT 7AM-9PM
> SUN 8AM-8PM
> Spruce Grove
> 7050
> SPRUCE GROVE
> 180 Hwy. 16A
> (780) 960-5600
> M-F 7AM-9PM
> SAT 7AM-9PM
> SUN 8AM-8PM
> St. Albert
> 7088
> ST. ALBERT
> 750 St. Albert Road
> (780) 458-4026
> M-F 7AM-10PM
> SAT 7AM-9PM
> SUN 8AM-8PM
> 
> The last entry is the SUN (...) line, so every record has 8 fields.  
> 
> Anybody have an approach to this?  My approach would be to replace all \n 
> with \t, then grep for SUN(.+)PM\t and replace with (1)\n but I would like to 
> see how others would parse it.  Could prove interesting.
> 
> Cheers
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a 
> feature request or would like to report a problem, please email
> "[email protected]" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].

Reply via email to