Provided I correctly understand the task at hand :-), the Entab
command (Text -> Entab) set to a tab width of 4 spaces should do
what you need.
Regards,
Patrick Woolsey
==
Bare Bones Software, Inc. <
http://www.barebones.com/>
On 2/25/16 at 3:05 PM,
bepo...@gmail.com (Brian Porter) wrote:
>I'm trying to find a trick for using the grep-enabled
>Find/Replace BBEdit to convert files that use spaces for
>indentation to using tabs. Here's an example input text snippet:
>
>1. Item
>a. sub-item
>i. third level
>ii. another third level
>2. Second Top Level
>
>
>What I'd like to do is replace all sets-of-4-spaces at the
>beginning of the line with a single tab (per each 4-space-set),
>but it seems like this would require being able to count the
>*number *of matches and use that in the back reference somehow
>
>For example, the following search and replace patterns can be
>used to replace the *first *set of spaces with a tab, but this
>pattern must be applied repeatedly for every "level" of indent
>being used in the file:
>
>*Find:*
>^(\t*)(\ \ \ \ )
>
>*Replace:*
>\1\t
>
>
>Ideally I want something like this:
>
>*Find:*
>^((\ \ \ \ )+)
>
>*Replace:*