grep help

2011-10-23 Thread Ken Lanxner

Hi.

How do I write a pattern to match a string that must contain 1 
or more tabs and may also contain 1 or more spaces --- in any order.


These would match:

tab
tab tab
tab space tab
space tab tab
tab space tab space

but a string of just 1 or more spaces would not match.

Thanks!

Ken

--
Simple Lives Web Design
http://simplelives.com

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

Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Files won't open

2011-10-23 Thread Doug McNutt
At 19:02 -0700 10/22/11, Watts Martin wrote:
On Oct 21, 2011, at 16:43 , Doug McNutt wrote:

bbedit will not process files that have mixed line ends.
It won't even allow you to repair such files.
As an example try opening a bbedit worksheet as a plain text file.


I put a few commands in a new blank worksheet, saved it as testme.worksheet, 
then forced it to open as a new plain text file by opening it on the command 
line with:

   cat testme.worksheet | bbedit

...and it opened as a text file just fine. What is it you were trying?


Well.  I might have been a bit brusque.  Today, using bbedit  8.5.2 which is as 
far as I can go with X 10.3.9 which is as far as I can go and still use my 
SE/30 file server. . .

I can in fact open files, such as a bbedit worksheet, in text mode.  I swear 
there was a time when bbedit would simply refuse to open such files.  Linux 
gedit continues to do just that and I do remember comparing it to bbedit at the 
time. It was when Bare Bones started using 16 bit words during its editing 
process that I first had problems. That might have been version 8.0. Version 
8.5 still works fine on this 8500 but there an escaped n means 0D and the 
escape character is OPTION d. Yes. I still use MPW.

Version 8.5.2 bbedit worksheets are really XML files of the Apple plist 
variety. The line ends for the XML part are 0A or \n . The worksheet part is a 
dict. entry inside of the XML which uses 0D or \r to separate lines as they 
would be interpreted in a Terminal worksheet.

If you open a worksheet as text, piping as above is one way, the file appears 
to be plain text and, except for visibility of the XML parts, is just like the 
worksheet. But you'll have trouble editing it and saving the results as a 
working worksheet. I really wanted to do things like that so I could muck with 
the saved startup directory and perhaps more like automatically running a shell 
script as each worksheet is opened.

When you save a worksheet opened that way all line ends will be converted to 
the end character specified in the tool bar at the bottom of the edit window. 
That means the modified file cannot have different ends for the XML and dict. 
parts as apparently required by the format. After modification and storage it 
will not work as a worksheet regardless of the creator and type settings. I 
always keep file specific settings in its resource fork.  Bbedit also can save 
such things in a time-expiring list in someone's home directory. The difference 
might be important in the piping technique used above.

Actually, worksheets remain a small part of the real problem.  I work with 
machine tools and other text-like command or assembler files that need viewing 
of variable width tab separated columns, and a couple of different line end 
characters that are used for different purposes.  Bare Bones does not feel it 
appropriate to support those things and neither does anyone else.  Spreadsheets 
are what I use when I can but more often it's home grown perl scripts without 
the benefits of a GUI editor. Full fledged word processors offer entirely too 
much and often make it nearly impossible to save without any markups at all. 
Nisus in its earlier versions was nice for that but as of OS neXt it's just 
like all of the others.

ftp://ftp.macnauchtan.com/Software/LineEnds/  might be interesting to some. 
It's  Applescripted C that I worked out to work with line ends. Source code 
included. There was another gentleman on this list whose problems were similar 
to mine a few years ago. He offered some C code that worked with 0A and 0D. I 
dressed it up to include 0D0A pairs and provided a drag and drop AppleScript 
interface which changes line ends and allows for an Examine that generates a 
count of all 3 line ends.

ftp://ftp.macnauchtan.com/Software/BBEdit/  Also has some stuff that allows 
worksheets to execute some csh code as they are opened. It does not try to edit 
the internals of a worksheet.


-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit