On 3/21/06 at 2:18 PM, [EMAIL PROTECTED] (Eric Bergman) wrote:

>Sorry, pad with spaces, not zeros.
>
>On Mar 21, 2006, at 2:12 PM, Eric Bergman wrote:

>>Is there a simple way in BBEdit to convert a file with variable-
>>length lines (and a hard return on each one) so that all lines
>>have a specific length? In other words, I want to pad lines out to
>>some column with zeros.

One way to do this would be with a text factory using grep. The first step 
would be to match (.+) and replace with \1 followed by a sufficient number of 
spaces to ensure each line is at least as long as you want. Then search for 
(.{n}).+ where n is the desired line length and replace with \1.

Strictly speaking, a text factory isn't necessary. But if you will be using 
this more than once on more than one file, a text factory offers a simple way 
to automatically apply this change to multiple files.

-- 
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to