> 
> Well, if it’s taking a perl script to do it then I don’t feel quite so bad 
> for failing to manage it with grep.

Well, you can do this with grep, but not in one go (imo). Try

search:
(\d+#)(.+?)\r\1
replace (beware: there is a space ' ' character after the \1\2):
\1\2 

Now, simply repeat this "Replace All" command over and over until BBEdit 
reports no further hits. Your document should now look like this:

1#some text goes here not hard wrapped to the line length
2#while other text is here
3#some here
4#also here and there and everywhere

Finally remove the numbers with

search:
^\d+#
replace with (again there is a space ' ' after the #)
# 

I tried this on your sample data and it delivered the result you described.

Enjoy,
Roland

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
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].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to