How to automatically add something at beginning and end of each line?

5,620 views
Skip to first unread message

yozloy

unread,
Dec 5, 2009, 9:25:11 PM12/5/09
to BBEdit Talk
Hi, Everybody!
I'm working on a project to convert some text to html.

what I got is many paragraphs, It makes sense use some functions to
add <p> at the beginning of each line and</p> and the end of each
line.

any advice?

Brian Frick

unread,
Dec 5, 2009, 10:14:18 PM12/5/09
to bbe...@googlegroups.com
Generally the manual would answer this.

Text -> prefix/suffix lines.
--
Brian

> --
> 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 bbe...@googlegroups.com
> To unsubscribe from this group, send email to
> bbedit+un...@googlegroups.com
> 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 "sup...@barebones.com" rather than posting to the group.

Lewis Butler

unread,
Dec 6, 2009, 12:57:52 AM12/6/09
to bbe...@googlegroups.com
On Dec 5, 2009, at 19:25, yozloy <yoz...@gmail.com> wrote:

> any advice?

Yep. Take a good long look at the text menu.

:)

Dennis Whiteman

unread,
Dec 6, 2009, 9:33:31 AM12/6/09
to BBEdit Talk
Alternatively, this grep search and replace would work...

Search:
(.*)\r

Replace:
<p>\1</p>\r

If you only perform it on the selected text, it'll give a bit of
control over how greedy it is. If your paragraphs are separated by two
returns, then add another /r at the end of the search and replace
strings.

Dennis
Dennis Whiteman
FastPipe Media, Inc.
http://www.fastpipe.com/

Dave

unread,
Dec 7, 2009, 9:52:44 AM12/7/09
to BBEdit Talk


On Dec 6, 9:33 am, Dennis Whiteman <fastp...@gmail.com> wrote:
> Alternatively, this grep search and replace would work...
>
> Search:
> (.*)\r
>
> Replace:
> <p>\1</p>\r
>
> If you only perform it on the selected text, it'll give a bit of
> control over how greedy it is. If your paragraphs are separated by two
> returns, then add another /r at the end of the search and replace
> strings.

Or leave the returns out entirely and change .* to .+, so only lines
with one or more characters will be affected.
Reply all
Reply to author
Forward
0 new messages