Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

ntb-clips · The NoteTab Clips List

The Yahoo! Groups Product Blog

Check it out!

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 19756 - 19785 of 23891   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#19756 From: "Sheri" <silvermoonwoman@...>
Date: Fri Oct 9, 2009 10:52 pm
Subject: [Clip] Re: title varible
silvermoonwo...
Send Email Send Email
 
--- In ntb-clips@yahoogroups.com, tom thomas <tom@...> wrote:
>
> This does the same as my clip
>
> ^!If ^$GetSelSize$=0 Next Else Skip_2
> ^!MoveCursor ^%GetRow%:0
> ^!Select EOL
> ^!Set %mod%=^$GetDocMatchAll("[!\x20.,?]+";"")$
> ^!Jump Select_Start
> ^!InsertText ^%mod%^%NL%
> ^!ClearVariable %mod%
> ;end of clip
>
> The original is not there.
>
> And NoteTab Pro 5.1
>
> Thanks,
> Tom

I posted a correction.

the line:
^!MoveCursor ^%GetRow%:0
should be:
^!SetCursor ^%GetRow%:1

Using ^$GetDocMatchAll can't possibly do what you want, it would produce a
string separated by semicolons of the runs of exclamation points, etc. The clip
would insert that string with a line break in front of the selection.

^$GetDocReplaceAll was introduced in version 5.7.

Current NoteTab version is 6.12. It should be a free update from 5.1.

There have been many improvements and bug fixes since 5.1.

Regards,
Sheri

#19757 From: "flo.gehrke" <flo.gehrke@...>
Date: Fri Oct 9, 2009 10:59 pm
Subject: [Clip] Re: title varible
flo.gehrke
Send Email Send Email
 
--- In ntb-clips@yahoogroups.com, tom thomas <tom@...> wrote:
>
> I get an error for this line
>
> ^!Set %mod%=^$GetDocReplaceAll("[!\x20.,?]+";"")$

Tom,

I think Sheri gave you a perfect solution -- if run with the latest version.
Here's another idea that possibly works with v5.1.

Regarding your ^!Replace commands: Combining H and W makes no sense. Either it's
W (whole document) or H (highlighted text only). In this case, I think you mean
H.

Line #5 in your clip removes spaces. But I understand they must not be removed
from the original titel.

The following clip will turn any line like...

This, is. my? title!

into...

Thisismytitle
This is my title


^!IfEmpty ^$GetSelection$ Next Else Skip_2
^!Info There's nothing selected!
^!Goto End
;  Remove punctuation marks but no spaces
^!Replace "[[:punct:]]" >> "" HARS
;  Remove spaces from selection
^!SetClipboard ^$StrReplace(" ";"";^$GetSelection$;0;0)$
^!Jump Line_Start
^!InsertText ^$GetClipboard$^P


Regards,
Flo

#19758 From: tom thomas <tom@...>
Date: Fri Oct 9, 2009 11:03 pm
Subject: Re: [Clip] Re: title varible
tom@...
Send Email Send Email
 
Yes, you are right. I created a new clip from yours, but I think I
click my old one by mistake, thinking it was yours.

Tom

At 06:52 PM 10/9/2009, you wrote:
>
>
>
>
>--- In
><mailto:ntb-clips%40yahoogroups.com>ntb-clips@yahoogroups.com, tom
>thomas <tom@...> wrote:
> >
> > This does the same as my clip
> >
> > ^!If ^$GetSelSize$=0 Next Else Skip_2
> > ^!MoveCursor ^%GetRow%:0
> > ^!Select EOL
> > ^!Set %mod%=^$GetDocMatchAll("[!\x20.,?]+";"")$
> > ^!Jump Select_Start
> > ^!InsertText ^%mod%^%NL%
> > ^!ClearVariable %mod%
> > ;end of clip
> >
> > The original is not there.
> >
> > And NoteTab Pro 5.1
> >
> > Thanks,
> > Tom
>
>I posted a correction.
>
>the line:
>^!MoveCursor ^%GetRow%:0
>should be:
>^!SetCursor ^%GetRow%:1
>
>Using ^$GetDocMatchAll can't possibly do what you want, it would
>produce a string separated by semicolons of the runs of exclamation
>points, etc. The clip would insert that string with a line break in
>front of the selection.
>
>^$GetDocReplaceAll was introduced in version 5.7.
>
>Current NoteTab version is 6.12. It should be a free update from 5.1.
>
>There have been many improvements and bug fixes since 5.1.
>
>Regards,
>Sheri
>
>

#19759 From: tom thomas <tom@...>
Date: Fri Oct 9, 2009 11:21 pm
Subject: Re: [Clip] Re: title varible
tom@...
Send Email Send Email
 
I upgraded, no errors, but still does not work

This

This Is My Title

Becomes this

   ; ;
This Is My Title


Clip code:

^!If ^$GetSelSize$=0 Next Else Skip_2
^!SetCursor ^%GetRow%:1
^!Select EOL
^!Set %mod%=^$GetDocMatchAll("[!\x20.,?]+";"")$
^!Jump Select_Start
^!InsertText ^%mod%^%NL%
^!ClearVariable %mod%
;end of clip

Thanks,
Tom Thomas

At 06:52 PM 10/9/2009, you wrote:
>
>
>
>
>--- In
><mailto:ntb-clips%40yahoogroups.com>ntb-clips@yahoogroups.com, tom
>thomas <tom@...> wrote:
> >
> > This does the same as my clip
> >
> > ^!If ^$GetSelSize$=0 Next Else Skip_2
> > ^!MoveCursor ^%GetRow%:0
> > ^!Select EOL
> > ^!Set %mod%=^$GetDocMatchAll("[!\x20.,?]+";"")$
> > ^!Jump Select_Start
> > ^!InsertText ^%mod%^%NL%
> > ^!ClearVariable %mod%
> > ;end of clip
> >
> > The original is not there.
> >
> > And NoteTab Pro 5.1
> >
> > Thanks,
> > Tom
>
>I posted a correction.
>
>the line:
>^!MoveCursor ^%GetRow%:0
>should be:
>^!SetCursor ^%GetRow%:1
>
>Using ^$GetDocMatchAll can't possibly do what you want, it would
>produce a string separated by semicolons of the runs of exclamation
>points, etc. The clip would insert that string with a line break in
>front of the selection.
>
>^$GetDocReplaceAll was introduced in version 5.7.
>
>Current NoteTab version is 6.12. It should be a free update from 5.1.
>
>There have been many improvements and bug fixes since 5.1.
>
>Regards,
>Sheri
>
>

#19760 From: tom thomas <tom@...>
Date: Fri Oct 9, 2009 11:27 pm
Subject: Re: [Clip] Re: title varible
tom@...
Send Email Send Email
 
Silly me, I copied from my own email message instead of yours. Your
original clip works

^!If ^$GetSelSize$=0 Next Else Skip_2
^!SetCursor ^$GetRow$:1
^!Select EOL
^!Set %mod%=^$GetDocReplaceAll("[!\x20.,?]+";"")$
^!Jump Select_Start
^!InsertText ^%mod%^%NL%
^!ClearVariable %mod%
^!Goto End
;end of clip

Results

ThisIsMyTitle
This Is My Title


That's what I want.

Thanks,
Tom Thomas


At 06:52 PM 10/9/2009, you wrote:
>
>
>
>
>--- In
><mailto:ntb-clips%40yahoogroups.com>ntb-clips@yahoogroups.com, tom
>thomas <tom@...> wrote:
> >
> > This does the same as my clip
> >
> > ^!If ^$GetSelSize$=0 Next Else Skip_2
> > ^!MoveCursor ^%GetRow%:0
> > ^!Select EOL
> > ^!Set %mod%=^$GetDocMatchAll("[!\x20.,?]+";"")$
> > ^!Jump Select_Start
> > ^!InsertText ^%mod%^%NL%
> > ^!ClearVariable %mod%
> > ;end of clip
> >
> > The original is not there.
> >
> > And NoteTab Pro 5.1
> >
> > Thanks,
> > Tom
>
>I posted a correction.
>
>the line:
>^!MoveCursor ^%GetRow%:0
>should be:
>^!SetCursor ^%GetRow%:1
>
>Using ^$GetDocMatchAll can't possibly do what you want, it would
>produce a string separated by semicolons of the runs of exclamation
>points, etc. The clip would insert that string with a line break in
>front of the selection.
>
>^$GetDocReplaceAll was introduced in version 5.7.
>
>Current NoteTab version is 6.12. It should be a free update from 5.1.
>
>There have been many improvements and bug fixes since 5.1.
>
>Regards,
>Sheri
>
>

#19761 From: "Sheri" <silvermoonwoman@...>
Date: Sat Oct 10, 2009 2:03 pm
Subject: [Clip] Re: title varible
silvermoonwo...
Send Email Send Email
 
--- In ntb-clips@yahoogroups.com, tom thomas <tom@...> wrote:
>
> Silly me, I copied from my own email message instead of yours. Your
> original clip works
>
> ^!If ^$GetSelSize$=0 Next Else Skip_2
> ^!SetCursor ^$GetRow$:1
> ^!Select EOL
> ^!Set %mod%=^$GetDocReplaceAll("[!\x20.,?]+";"")$
> ^!Jump Select_Start
> ^!InsertText ^%mod%^%NL%
> ^!ClearVariable %mod%
> ^!Goto End
> ;end of clip
>
> Results
>
> ThisIsMyTitle
> This Is My Title
>
>
> That's what I want.
>
> Thanks,
> Tom Thomas

Great, glad you got it!

> >
> >I posted a correction.
> >
> >the line:
> >^!MoveCursor ^%GetRow%:0
> >should be:
> >^!SetCursor ^%GetRow%:1


I see I had again typed it with percents instead of dollar signs. Sorry about
that.

^!Jump Line_Start

would have been a better way to do that.

Regards,
Sheri

#19762 From: "John Shotsky" <jshotsky@...>
Date: Sat Oct 10, 2009 8:37 pm
Subject: Headline Case help
shotsky1
Send Email Send Email
 
I would like to change the case of book and recipe titles to 'headline case'
which means most of the words are
capitalized, but less important words are not. (Like a, and, the, with). I
currently use the StrCapitalize function to
capitalize the words in the titles, but that capitalizes every word.

I can produce a list of words that should not be capitalized, but I'm not sure
how to compare the words in the titles to
the list, and how to to then lower case any word found in the list. Each title
is 'tagged' with the word 'Title', and
there are no line breaks, but there is often a secondary title in parentheses.
(Also, if the word is the first or last
word of the title, it must be capitalized.)

Anyone ever do this before?
Thanks,
John




[Non-text portions of this message have been removed]

#19763 From: Axel Berger <Axel-Berger@...>
Date: Sat Oct 10, 2009 9:08 pm
Subject: Re: [Clip] Headline Case help
absalom_nemini
Send Email Send Email
 
John Shotsky wrote:
> I can produce a list of words that should not be capitalized,

I'm sure Sheri will come up with a much more elegant solution, but this
is how I dealt with a comparable problem:

^!Jump TEXT_START
:loop
^!Find "<sensible string with title itself in brackets>" HRS1
;^!Continue
^!IfError clean
^!InsertSelect ^$StrReplace("A";"a";"^$GetSelection$";TRUE;TRUE)$
^!InsertSelect ^$StrReplace("With";"with";"^$GetSelection$";TRUE;TRUE)$
^!InsertSelect ^$StrReplace("The";"the";"^$GetSelection$";TRUE;TRUE)$
^!InsertText ^$StrReplace("And";"and";"^$GetSelection$";TRUE;TRUE)$
^!Goto loop
:clean

I've not solved your first and last word exception. Ideally you make the
^!Find such, that both are outside the bracket. You could use <start of
line>[^ ] (.+?) [^ ]<end of line>. It's always a bit tricky to make a
^!Find that finds all instances without fail but no more.

Good luck
Axel

#19764 From: Axel Berger <Axel-Berger@...>
Date: Sat Oct 10, 2009 9:15 pm
Subject: Re: [Clip] Headline Case help
absalom_nemini
Send Email Send Email
 
John Shotsky wrote:
> (Also, if the word is the first or last
> word of the title, it must be capitalized.)

Are you sure about the last word there? Admittedly, using English title
case correctly does not come easily for a dumb Jerry (it's not done in
German), but I try to do my best. How about "Words One Must Never End a
Sentence with" or "People Seldom Spoken to" compared to "Words with
Which a Sentence Must Never Be Ended" or "People to Whom Nobody Speaks"?

Thanks
	 Axel

#19765 From: "John Shotsky" <jshotsky@...>
Date: Sat Oct 10, 2009 9:23 pm
Subject: RE: [Clip] Headline Case help
shotsky1
Send Email Send Email
 
I'm using the Chicago Manual of Style as my guideline. There are exceptions to
force capitalization of things that are
stressed, but always, the first and last words are capitalized in titles of
things. Of course, writers can come up with
titles of books that have no capitals, like 'capitalization for dummies', but
those are outside my interest.
Thanks,
John

From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of
Axel Berger
Sent: Saturday, October 10, 2009 14:15
To: ntb-clips@yahoogroups.com
Subject: Re: [Clip] Headline Case help


John Shotsky wrote:
> (Also, if the word is the first or last
> word of the title, it must be capitalized.)

Are you sure about the last word there? Admittedly, using English title
case correctly does not come easily for a dumb Jerry (it's not done in
German), but I try to do my best. How about "Words One Must Never End a
Sentence with" or "People Seldom Spoken to" compared to "Words with
Which a Sentence Must Never Be Ended" or "People to Whom Nobody Speaks"?

Thanks
Axel



[Non-text portions of this message have been removed]

#19766 From: Axel Berger <Axel-Berger@...>
Date: Sat Oct 10, 2009 9:33 pm
Subject: OT: Headline Case help
absalom_nemini
Send Email Send Email
 
John Shotsky wrote:
> I'm using the Chicago Manual of Style as my guideline.

I bit on the expensive side. Is there anything comparable around for
British English?

Thanks
	 Axel

#19767 From: "John Shotsky" <jshotsky@...>
Date: Sat Oct 10, 2009 10:12 pm
Subject: RE: [Clip] OT: Headline Case help
shotsky1
Send Email Send Email
 
You might review this link to see if anything is suitable for you.
http://en.wikipedia.org/wiki/Style_guide#United_Kingdom
John

From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of
Axel Berger
Sent: Saturday, October 10, 2009 14:34
To: ntb-clips@yahoogroups.com
Subject: [Clip] OT: Headline Case help


John Shotsky wrote:
> I'm using the Chicago Manual of Style as my guideline.

I bit on the expensive side. Is there anything comparable around for
British English?

Thanks
Axel



[Non-text portions of this message have been removed]

#19768 From: Sheri <silvermoonwoman@...>
Date: Sun Oct 11, 2009 3:02 pm
Subject: Re: [Clip] Headline Case help
silvermoonwo...
Send Email Send Email
 
Axel Berger wrote:
> John Shotsky wrote:
>
>> I can produce a list of words that should not be capitalized,
>>
>
> I'm sure Sheri will come up with a much more elegant solution, but this
> is how I dealt with a comparable problem:
>
> ^!Jump TEXT_START
> :loop
> ^!Find "<sensible string with title itself in brackets>" HRS1
> ;^!Continue
> ^!IfError clean
> ^!InsertSelect ^$StrReplace("A";"a";"^$GetSelection$";TRUE;TRUE)$
> ^!InsertSelect ^$StrReplace("With";"with";"^$GetSelection$";TRUE;TRUE)$
> ^!InsertSelect ^$StrReplace("The";"the";"^$GetSelection$";TRUE;TRUE)$
> ^!InsertText ^$StrReplace("And";"and";"^$GetSelection$";TRUE;TRUE)$
> ^!Goto loop
> :clean
>
> I've not solved your first and last word exception.
Maybe by putting a space before and after each word to be lowercased? e.g.,

^$StrReplace(" A ";" a ";"^$GetSelection$";TRUE;TRUE)$



>  Ideally you make the
> ^!Find such, that both are outside the bracket. You could use <start of
> line>[^ ] (.+?) [^ ]<end of line>. It's always a bit tricky to make a
> ^!Find that finds all instances without fail but no more.
>
>

Should be easy to find titles that have one of the target words, again
surrounded by spaces.

e.g., ^!Find "^TITLE::\R\K.*?\x20(?:A|The|Of|With)\x20.++" RS

The \R is in there because from old samples I think the title tag is
separated from the actual title by a line break.

Regards,
Sheri

#19769 From: "flo.gehrke" <flo.gehrke@...>
Date: Sun Oct 11, 2009 3:45 pm
Subject: Re: Headline Case help
flo.gehrke
Send Email Send Email
 
--- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:
>
> I would like to change the case of book and recipe titles
> to 'headline case' which means most of the words are
> capitalized, but less important words are not. (Like a, and, the,
> with).
> Each title is 'tagged' with the word 'Title', and
> there are no line breaks, but there is often a secondary title in
> parentheses. (Also, if the word is the first or last
> word of the title, it must be capitalized.)

Just an idea...


^!Jump Doc_Start

:Loop1
^!Find "Title" S
^!IfError End

:Loop2
^!Select Line
^!Toolbar Capitalize
^!Jump Line_Start
^!Find "(?-i)(?<!Title\x20)\b(Of|The|To|With|A)\b(?!$)" RS
^!IfError Out
^!Toolbar Lower Case
^!Goto Skip_-3

:Out
^!If ^$GetRow$ = ^$GetTextLineCount$ End Else Loop1

Tested with...


any text
Title the best recipes with ice and fruit you have ever heard of
any text
Title a danger of the traffic you have to be ware of
any text


The first word after 'Title' and the last word is kept in upper case. More words
may be added to the alternation.

Someone else may find a solution for "a secondary title in parentheses". Is it
also tagged with 'Title'? If not, are there any more lines which are in
parentheses but are no secondary titles? Does the secondary title always follow
in the next line or is on the same line etc...

Tested with NT Pro 6.12.

Regards,
Flo

#19770 From: "John Shotsky" <jshotsky@...>
Date: Sun Oct 11, 2009 6:20 pm
Subject: RE: [Clip] Re: Headline Case help
shotsky1
Send Email Send Email
 
Thanks, Flo,

I think that will work after a little massaging on my part. I'll just have to
make a long list of words to alternate,
but that's no problem.

The second title is usually in a different language, such as in recipe titles
where there is an English title and an
Italian title. They are always on the same line. I'll just have to add a few
foreign words to my list. I note that the
last word in the first title is not capitalized when there is a second title in
parens. I think I can figure out how to
handle that one.

The reason I was thinking to use a separate list of the words was so it could be
sent to my user base without having to
update the clip library at the same time. But this will work for now, I release
new versions often.
John

From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of
flo.gehrke
Sent: Sunday, October 11, 2009 08:45
To: ntb-clips@yahoogroups.com
Subject: [Clip] Re: Headline Case help


--- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> , "John
Shotsky" <jshotsky@...> wrote:
>
> I would like to change the case of book and recipe titles
> to 'headline case' which means most of the words are
> capitalized, but less important words are not. (Like a, and, the,
> with).
> Each title is 'tagged' with the word 'Title', and
> there are no line breaks, but there is often a secondary title in
> parentheses. (Also, if the word is the first or last
> word of the title, it must be capitalized.)

Just an idea...

^!Jump Doc_Start

:Loop1
^!Find "Title" S
^!IfError End

:Loop2
^!Select Line
^!Toolbar Capitalize
^!Jump Line_Start
^!Find "(?-i)(?<!Title\x20)\b(Of|The|To|With|A)\b(?!$)" RS
^!IfError Out
^!Toolbar Lower Case
^!Goto Skip_-3

:Out
^!If ^$GetRow$ = ^$GetTextLineCount$ End Else Loop1

Tested with...

any text
Title the best recipes with ice and fruit you have ever heard of
any text
Title a danger of the traffic you have to be ware of
any text

The first word after 'Title' and the last word is kept in upper case. More words
may be added to the alternation.

Someone else may find a solution for "a secondary title in parentheses". Is it
also tagged with 'Title'? If not, are
there any more lines which are in parentheses but are no secondary titles? Does
the secondary title always follow in the
next line or is on the same line etc...

Tested with NT Pro 6.12.

Regards,
Flo



[Non-text portions of this message have been removed]

#19771 From: Alec Burgess <buralex@...>
Date: Sun Oct 11, 2009 10:30 pm
Subject: Re: [Clip] Re: Search and Replace and increment number at the same time
alecb3ca
Send Email Send Email
 
Sheri (silvermoonwoman@...) wrote (in part)  (on 2009-10-02 at
00:22):
  > --- In ntb-clips@yahoogroups.com, Don Daugherty <daugherty@...> wrote:
  > >
  > > Sheri wrote:
  > > > Yes, the clip code to do it follows.
... SNIP
  > > > ^!Find "/y=\K\d+" RS
... SNIP
  > > What is \K in the ^!Find command? I don't find it documented in
  > > the Clip Programming Help file.
  > > Don Daugherty
  > >
  >
  > Hi Don,
  >
  > You should find it in the Regular Expressions Help file. Everything
  > before and after the \K has to match, but the part before the \K gets
  > discarded. The regex help file calls it resetting the match start.

(sorry for late response but I just got back from holiday - two weeks in
Europe - yippee!)

I've seen you and Flo use the \K construct before w/o ever really
understanding exactly how it worked.

AFAICT - (?<=/y=)\d+  (where (?<...) is positive lookbehind) is
equivalent to /y=\K\d+
Now that I know what the \K does, is there any difference between the
two (other than the simplicity of \K)

FWIW: Sheri I'm sure knows this, but \K is a fairly recent addition to
PCRE regex syntax. It's not yet supported by RegexBuddy as I discovered
when I tried to test in it ;-)

--
Regards ... Alec   (buralex@gmail & WinLiveMess - alec.m.burgess@skype)

#19772 From: "flo.gehrke" <flo.gehrke@...>
Date: Sun Oct 11, 2009 10:33 pm
Subject: [Clip] Re: Headline Case help
flo.gehrke
Send Email Send Email
 
--- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:
>
> The reason I was thinking to use a separate list of the words
> was so it could be sent to my user base without having to
> update the clip library at the same time.

John,

This is a version that works with a separate WORDLIST.TXT containing the words
to be written in lower case...


And
For
Für
Of
The
To
With
A


The clip (with some slight corrections) would be...


^!Set
%Search%=^$StrReplace("^P";"|";"^$GetFileText(^$GetDocumentPath$WORDLIST.TXT)$";\
0;0)$
^!Jump Doc_Start

:Loop1
^!Find "^Title.+$" RS
^!IfError End

:Loop2
^!Toolbar Capitalize
^!Jump Line_Start
^!Find "(?-i)(?<!Title\x20)\b(^%Search%)\b(?!$)" RS
^!IfError Out
^!Toolbar Lower Case
^!Goto Skip_-3

:Out
^!If ^$GetRow$ = ^$GetTextLineCount$ End Else Loop1


Successfully tested with...

any text
Title the best recipes with ice and fruit you have ever heard of
any text
Title a danger of the traffic you have to be aware Of
any text
Title cooking for beginners (kochen für anfänger)


I can't figure why you "note that the last word in the first title is not
capitalized when there is a second title in parens." How come, if it's on the
same line? To find out we would need some more sample text.

Regards,
Flo

#19773 From: "flo.gehrke" <flo.gehrke@...>
Date: Sun Oct 11, 2009 11:05 pm
Subject: [Clip] Re: Search and Replace and increment number at the same time
flo.gehrke
Send Email Send Email
 
--- In ntb-clips@yahoogroups.com, Alec Burgess <buralex@...> wrote:

> I've seen you (Sheri) and Flo use the \K construct before w/o
> ever really understanding exactly how it worked.
> Now that I know what the \K does, is there any difference between the
> two (other than the simplicity of \K)

Alec,

As you you wrote, \K is similar to a Lookbehind Assertion. So (?<=Look)behind
matches 'Lookbehind' without consuming the 'Look'. Look\Kbehind has the same
effect.

The difference is that the Lookbehind demands a fixed lenghth of the pattern
whereas \K works with any length. That's why I often prefer \K.

For example: (?<=\w+)behind produces an Error Message "Regex error: lookbehind
assertion is not of fixed length." In contrast to that, \w+\Kbehind works fine.

Regards,
Flo

#19774 From: Axel Berger <Axel-Berger@...>
Date: Sun Oct 11, 2009 11:02 pm
Subject: Re: [Clip] Re: Headline Case help
absalom_nemini
Send Email Send Email
 
"flo.gehrke" wrote:
> The clip (with some slight corrections) would be...

This is great. My more simple-minded solution works well for the task I
wrote it for, but it good to keep in mind all the more powerful versions
I learn about here.

Axel

#19775 From: "John Shotsky" <jshotsky@...>
Date: Sun Oct 11, 2009 11:10 pm
Subject: RE: [Clip] Re: Headline Case help
shotsky1
Send Email Send Email
 
Thanks! That is going to be very helpful. I like the German words!

Here's the sample title I used:
Title a danger of the traffic you have to be aware of (a danger of the traffic
you have to be aware of)

I obviously have a lot more to learn. I'll try to decipher your code to see how
it works.
Good stuff!
John

From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of
flo.gehrke
Sent: Sunday, October 11, 2009 15:34
To: ntb-clips@yahoogroups.com
Subject: [Clip] Re: Headline Case help


--- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> , "John
Shotsky" <jshotsky@...> wrote:
>
> The reason I was thinking to use a separate list of the words
> was so it could be sent to my user base without having to
> update the clip library at the same time.

John,

This is a version that works with a separate WORDLIST.TXT containing the words
to be written in lower case...

And
For
Für
Of
The
To
With
A

The clip (with some slight corrections) would be...

^!Set
%Search%=^$StrReplace("^P";"|";"^$GetFileText(^$GetDocumentPath$WORDLIST.TXT)$";\
0;0)$
^!Jump Doc_Start

:Loop1
^!Find "^Title.+$" RS
^!IfError End

:Loop2
^!Toolbar Capitalize
^!Jump Line_Start
^!Find "(?-i)(?<!Title\x20)\b(^%Search%)\b(?!$)" RS
^!IfError Out
^!Toolbar Lower Case
^!Goto Skip_-3

:Out
^!If ^$GetRow$ = ^$GetTextLineCount$ End Else Loop1

Successfully tested with...

any text
Title the best recipes with ice and fruit you have ever heard of
any text
Title a danger of the traffic you have to be aware Of
any text
Title cooking for beginners (kochen für anfänger)

I can't figure why you "note that the last word in the first title is not
capitalized when there is a second title in
parens." How come, if it's on the same line? To find out we would need some more
sample text.

Regards,
Flo



[Non-text portions of this message have been removed]

#19776 From: "flo.gehrke" <flo.gehrke@...>
Date: Sun Oct 11, 2009 11:27 pm
Subject: [Clip] Re: Headline Case help
flo.gehrke
Send Email Send Email
 
--- In ntb-clips@yahoogroups.com, Axel Berger <Axel-Berger@...> wrote:
>
> "flo.gehrke" wrote:
> > The clip (with some slight corrections) would be...
>
> This is great. My more simple-minded solution works well for the
> task I > wrote it for, but it good to keep in mind all the more
> powerful versions I learn about here.
>
> Axel

Thanks, Axel. It's nice to get some positive feedback every now and then...;-)

Flo

#19777 From: Alec Burgess <buralex@...>
Date: Sun Oct 11, 2009 11:20 pm
Subject: Re: [Clip] Re: Search and Replace and increment number at the same time
alecb3ca
Send Email Send Email
 
flo.gehrke (flo.gehrke@...) wrote (in part)  (on 2009-10-11 at
19:05):
>  --- In ntb-clips@yahoogroups.com, Alec Burgess <buralex@...> wrote:
>
>  > I've seen you (Sheri) and Flo use the \K construct before w/o
>  > ever really understanding exactly how it worked.
>  > Now that I know what the \K does, is there any difference between
>  the
>  > two (other than the simplicity of \K)
>
>  Alec,
>
>  As you you wrote, \K is similar to a Lookbehind Assertion. So
>  (?<=Look)behind matches 'Lookbehind' without consuming the 'Look'.
>  Look\Kbehind has the same effect.
>
>  The difference is that the Lookbehind demands a fixed lenghth of the
>  pattern whereas \K works with any length. That's why I often prefer
>  \K.
>
>  For example: (?<=\w+)behind produces an Error Message "Regex error:
>  lookbehind assertion is not of fixed length." In contrast to that,
>  \w+\Kbehind works fine.

Fixed length limitations in lookbehinds rang a bell when you mentioned
it. When I check with RegexBuddy I see that it fails with its (somewhat
old implementation of PCRE) but works with the JGSoft flavor (ie. Jan's
"superset" version of ALL regex flavors) and also with .NET flavor but
fails in most of the rest. For those that fail its indicated by marking
the "+" in RED.

I'm not sure if any future version of PCRE (and hence when supported by
Eric)  Notetab will support this. I'll try to remember the key
distinction wrt. to \K when I write clips. Thanks for the followup info
(and Don for the question!).
//

--
Regards ... Alec   (buralex@gmail & WinLiveMess - alec.m.burgess@skype)




[Non-text portions of this message have been removed]

#19778 From: "flo.gehrke" <flo.gehrke@...>
Date: Sun Oct 11, 2009 11:54 pm
Subject: [Clip] Re: Headline Case help
flo.gehrke
Send Email Send Email
 
--- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:

> Here's the sample title I used:
> Title a danger of the traffic you have to be aware of (a danger of
> the traffic you have to be aware of)

Thanks, John. Now I can see the problem!

Please replace the long ^!Find-line with...

^!Find "(?-i)(?<!Title\x20|\()\b(Of|The|To|With|A)\b(?!$|\x20\(|\))" RS

In my test, this is doing the job.

Regards,
Flo

#19779 From: Alec Burgess <buralex@...>
Date: Mon Oct 12, 2009 12:46 am
Subject: Re: [Clip] parse words and replace with SQL statement - never mind
alecb3ca
Send Email Send Email
 
flo.gehrke (flo.gehrke@...) wrote (in part)  (on 2009-10-09 at
18:40):
  > Your interpretation of the RegEx appears quite correct. In my words:
  >
  > (^[^\x20]+)\x20 matches all characters from the beginning of the line
  > that are no space and plus the next following space. The first
  > substring in parentheses goes into $1. All characters following the
  > space till the end of line go into $2. The replacement string just
  > outputs $1 and $2 combined with those SQL statements.
  >
  > > > I tried to use parts of what you said in the Find tool as a
  > > > regex...(^[^\x20]+) that selects the first 3 characters of
  > > > the first word (curious?).
  >
  > Certainly another v4.82 issue.

Mr. Phillip:

If you've got a lot of clips and want to check out possible problems
with conversion to v5 (now v6)  get the Lite version until you satisfy
yourself you want to change to the Pro version :-) :-$

If you want to try it with ver 4.x you might be able to get it to work
by fixing (ie. back-porting) Flo's clip as follows:
NTB 5 syntax (group expression) *was* {group expression}
-- ie. curly brace instead of round brace
NTB 5 syntax $1 $2 etc replacements was \1 \2 etc

wrt. your original clip: (not tested)

; put cursor back at line start
^!SetCursor ^%row%;1
; and select to end of line
^!Select EOL
; delete the line
^!Keyboard BACKSPACE

I basically try to avoid *all* use of ^!keyboard commands by the
(usually) available ^!Menu commands eg. ^!Menu Edit/Delete might replace
^!Keyboard BACKSPACE as is. I'm not sure whether the cursor would be
positioned exactly where you want it afterwards.

If its "off by one" you might correct it by adding a ^!MoveCursor +/-nnn
after the ^!Menu Edit/Delete.

--
Regards ... Alec   (buralex@gmail & WinLiveMess - alec.m.burgess@skype)

#19780 From: Sheri <silvermoonwoman@...>
Date: Mon Oct 12, 2009 4:14 am
Subject: Re: [Clip] Re: Search and Replace and increment number at the same time
silvermoonwo...
Send Email Send Email
 
Alec Burgess wrote:
> flo.gehrke (flo.gehrke@...) wrote (in part)  (on 2009-10-11 at
> 19:05):
>
>>  --- In ntb-clips@yahoogroups.com, Alec Burgess <buralex@...> wrote:
>>
>>  > I've seen you (Sheri) and Flo use the \K construct before w/o
>>  > ever really understanding exactly how it worked.
>>  > Now that I know what the \K does, is there any difference between
>>  the
>>  > two (other than the simplicity of \K)
>>
>>  Alec,
>>
>>  As you you wrote, \K is similar to a Lookbehind Assertion. So
>>  (?<=Look)behind matches 'Lookbehind' without consuming the 'Look'.
>>  Look\Kbehind has the same effect.
>>
>>  The difference is that the Lookbehind demands a fixed lenghth of the
>>  pattern whereas \K works with any length. That's why I often prefer
>>  \K.
>>
>>  For example: (?<=\w+)behind produces an Error Message "Regex error:
>>  lookbehind assertion is not of fixed length." In contrast to that,
>>  \w+\Kbehind works fine.
>>
>
> Fixed length limitations in lookbehinds rang a bell when you mentioned
> it. When I check with RegexBuddy I see that it fails with its (somewhat
> old implementation of PCRE) but works with the JGSoft flavor (ie. Jan's
> "superset" version of ALL regex flavors) and also with .NET flavor but
> fails in most of the rest. For those that fail its indicated by marking
> the "+" in RED.
>
> I'm not sure if any future version of PCRE (and hence when supported by
> Eric)  Notetab will support this. I'll try to remember the key
> distinction wrt. to \K when I write clips. Thanks for the followup info
> (and Don for the question!).
> //
>
>
PCRE seeks backward from its "bump-along" starting point for a
look-behind assertion.

The fixed length requirement will never change; however it is
permissible to have alternates of varying lengths within a look-behind.

In order to achieve the same match using \K instead of a look-behind
assertion, the bump-along position is at the beginning of the would-be
look-behind. So while the results are similar, the processing differs.

Regards,
Sheri

#19781 From: "ceff7" <ceff7@...>
Date: Mon Oct 12, 2009 4:29 pm
Subject: backup pasteclips
ceff7
Send Email Send Email
 
How do you copy and backup pasteclips?

#19782 From: "Dave" <dmc43959@...>
Date: Tue Oct 13, 2009 12:48 pm
Subject: Re: [Clip] backup pasteclips
david_99_au
Send Email Send Email
 
Hi
Either in windows drag and drop pasteclips.clb some where else or copy the
contents of pasteclips.clb to somewhere else it only text.
     THANKYOU DAVE


----- Original Message -----
From: "ceff7" <ceff7@...>
To: <ntb-clips@yahoogroups.com>
Sent: Tuesday, October 13, 2009 3:29 AM
Subject: [Clip] backup pasteclips


> How do you copy and backup pasteclips?
>
>
>
>
> ------------------------------------
>
> Fookes Software: http://www.fookes.com/
> NoteTab website: http://www.notetab.com/
> NoteTab Discussion Lists: http://www.notetab.com/groups.php
>
> ***
> Yahoo! Groups Links
>
>
>

#19783 From: "flo.gehrke" <flo.gehrke@...>
Date: Wed Oct 14, 2009 12:07 am
Subject: [Clip] Re: Headline Case help
flo.gehrke
Send Email Send Email
 
--- In ntb-clips@yahoogroups.com, "flo.gehrke" <flo.gehrke@...> wrote:
>
> --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@> wrote:
>
> > Here's the sample title I used:
> > Title a danger of the traffic you have to be aware of (a danger of
> > the traffic you have to be aware of)
>
> Thanks, John. Now I can see the problem!
>
> Please replace the long ^!Find-line with...
>
> ^!Find "(?-i)(?<!Title\x20|\()\b(Of|The|To|With|A)\b(?!$|\x20\(|\))" RS
>
> In my test, this is doing the job.
>
> Regards,
> Flo

To all who followed this thread,

Regarding the solution with wordlist file: Please note that the wordlist must
not end with an empty line. That's the notorious problem with an empty value in
alternations and arrays caused by empty lines from a list. You may also change
the first two lines to...

^!Set
%Search%=(^$StrReplace("^P";"|";"^$GetFileText(^$GetDocumentPath$WORDLIST.TXT)$"\
;0;0)$)
^!Set %Search%=^$StrReplace("|)";")";"^%Search%";0;0)$

If you prefer a solution without a big alternation and with simpler RegEx, try
this...


;  Assign wordlist to array
^!StatusShow Running!
^!SetScreenUpdate Off
^!SetListDelimiter ^%NL%
^!SetArray %Lower%=^$GetFileText(^$GetDocumentPath$TITLEWORDS.TXT)$
;  Strip empty value from end of array (with courtesy of Eb)
^!If ^%Lower^%Lower0%% = ^%Empty% ^!Dec %Lower0%
;  Capitalize titles
^!Jump Doc_Start
^!Find "^Title::.+$" RS
^!IfError Edit
^!Toolbar Capitalize
^!Goto Skip_-3

:Edit
;  Set selected words in titles to lower case
^!Set %ID%=1
^!Jump Doc_Start

:Loop1
^!Find "^Title::.*\b^%Lower^%ID%%\b.*$" RIS
^!IfError Loop3

:Loop2
^!Replace "^%Lower^%ID%%" >> "^%Lower^%ID%%" HIAS
^!Goto Loop1

:Loop3
^!Inc %ID%
^!If ^%ID% > ^%Lower0% FirstInLine
^!Jump Doc_Start
^!Goto Loop1

:FirstInLine
^!Jump Doc_Start
^!Find "^Title::\x20\K([[:lower:]]|"[[:lower:]])" RS
^!IfError AfterBracket
^!Toolbar Upper Case
^!Goto Skip_-3

:AfterBracket
^!Jump Doc_Start
^!Find "^Title::.+\(\K([[:lower:]]|"[[:lower:]])" RS
^!IfError BeforeClosBracket
^!Toolbar Upper Case
^!Goto Skip_-3

:BeforeClosBracket
^!Jump Doc_Start
^!Find "^Title::.+\x20\K[[:lower:]]+\)" RS
^!IfError BeforeOpenBracket
^!Toolbar Capitalize
^!Goto Skip_-3

:BeforeOpenBracket
^!Jump Doc_Start
^!Find "^Title::.+\x20\K[[:lower:]]+\x20\(" RS
^!IfError End
^!Toolbar Capitalize
^!Goto Skip_-3

:End
^!StatusClose
^!Jump Doc_Start
^!Info Finished!


I've tested it with the following sample text and NT Pro 6.12 (all in long lines
- no hard line breaks!)

any text
any text
Title:: a danger of the traffic you have to be aware of (a danger of the traffic
you have to be aware of)
any text
Title:: "a cup of joe's" beer with crackers
Title:: conejo en salmorejo (kaninchen in beize)
any text
Title:: a danger of the traffic you have to be aware of (a danger of the traffic
you have to be aware of)
any text
any text
Title:: potaje de trigo (eintopf mit weizen)
any text
any text
any text
Title:: a danger of the traffic you have to be aware of (a danger of the traffic
you have to be aware of)
any text
any text
any text
Title:: a danger of the traffic you have to be aware of (a danger of the traffic
you have to be aware of)


Regards,
Flo

#19784 From: "John Shotsky" <jshotsky@...>
Date: Wed Oct 14, 2009 12:50 am
Subject: RE: [Clip] Re: Headline Case help
shotsky1
Send Email Send Email
 
Wow, thanks, Flo!

I've spent hours trying to make this work with no success yet. I'll certainly
give this a try, and get back with any
further questions.

Best,
John

From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of
flo.gehrke
Sent: Tuesday, October 13, 2009 17:07
To: ntb-clips@yahoogroups.com
Subject: [Clip] Re: Headline Case help


--- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> ,
"flo.gehrke" <flo.gehrke@...> wrote:
>
> --- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> , "John
Shotsky" <jshotsky@> wrote:
>
> > Here's the sample title I used:
> > Title a danger of the traffic you have to be aware of (a danger of
> > the traffic you have to be aware of)
>
> Thanks, John. Now I can see the problem!
>
> Please replace the long ^!Find-line with...
>
> ^!Find "(?-i)(?<!Title\x20|\()\b(Of|The|To|With|A)\b(?!$|\x20\(|\))" RS
>
> In my test, this is doing the job.
>
> Regards,
> Flo

To all who followed this thread,

Regarding the solution with wordlist file: Please note that the wordlist must
not end with an empty line. That's the
notorious problem with an empty value in alternations and arrays caused by empty
lines from a list. You may also change
the first two lines to...

^!Set
%Search%=(^$StrReplace("^P";"|";"^$GetFileText(^$GetDocumentPath$WORDLIST.TXT)$"\
;0;0)$)
^!Set %Search%=^$StrReplace("|)";")";"^%Search%";0;0)$

If you prefer a solution without a big alternation and with simpler RegEx, try
this...

; Assign wordlist to array
^!StatusShow Running!
^!SetScreenUpdate Off
^!SetListDelimiter ^%NL%
^!SetArray %Lower%=^$GetFileText(^$GetDocumentPath$TITLEWORDS.TXT)$
; Strip empty value from end of array (with courtesy of Eb)
^!If ^%Lower^%Lower0%% = ^%Empty% ^!Dec %Lower0%
; Capitalize titles
^!Jump Doc_Start
^!Find "^Title::.+$" RS
^!IfError Edit
^!Toolbar Capitalize
^!Goto Skip_-3

:Edit
; Set selected words in titles to lower case
^!Set %ID%=1
^!Jump Doc_Start

:Loop1
^!Find "^Title::.*\b^%Lower^%ID%%\b.*$" RIS
^!IfError Loop3

:Loop2
^!Replace "^%Lower^%ID%%" >> "^%Lower^%ID%%" HIAS
^!Goto Loop1

:Loop3
^!Inc %ID%
^!If ^%ID% > ^%Lower0% FirstInLine
^!Jump Doc_Start
^!Goto Loop1

:FirstInLine
^!Jump Doc_Start
^!Find "^Title::\x20\K([[:lower:]]|"[[:lower:]])" RS
^!IfError AfterBracket
^!Toolbar Upper Case
^!Goto Skip_-3

:AfterBracket
^!Jump Doc_Start
^!Find "^Title::.+\(\K([[:lower:]]|"[[:lower:]])" RS
^!IfError BeforeClosBracket
^!Toolbar Upper Case
^!Goto Skip_-3

:BeforeClosBracket
^!Jump Doc_Start
^!Find "^Title::.+\x20\K[[:lower:]]+\)" RS
^!IfError BeforeOpenBracket
^!Toolbar Capitalize
^!Goto Skip_-3

:BeforeOpenBracket
^!Jump Doc_Start
^!Find "^Title::.+\x20\K[[:lower:]]+\x20\(" RS
^!IfError End
^!Toolbar Capitalize
^!Goto Skip_-3

:End
^!StatusClose
^!Jump Doc_Start
^!Info Finished!

I've tested it with the following sample text and NT Pro 6.12 (all in long lines
- no hard line breaks!)

any text
any text
Title:: a danger of the traffic you have to be aware of (a danger of the traffic
you have to be aware of)
any text
Title:: "a cup of joe's" beer with crackers
Title:: conejo en salmorejo (kaninchen in beize)
any text
Title:: a danger of the traffic you have to be aware of (a danger of the traffic
you have to be aware of)
any text
any text
Title:: potaje de trigo (eintopf mit weizen)
any text
any text
any text
Title:: a danger of the traffic you have to be aware of (a danger of the traffic
you have to be aware of)
any text
any text
any text
Title:: a danger of the traffic you have to be aware of (a danger of the traffic
you have to be aware of)

Regards,
Flo



[Non-text portions of this message have been removed]

#19785 From: "flo.gehrke" <flo.gehrke@...>
Date: Wed Oct 14, 2009 1:11 am
Subject: [Clip] Re: Headline Case help
flo.gehrke
Send Email Send Email
 
--- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:
>
> Wow, thanks, Flo!
> ....

Hi John,

What's the matter with your email address? I tried to sent you severeal emails
but they all came back with "Mail delivery failed".

If anyone wants to test this, here's the WORDLIST.TXT (courtesy John)...

a
á
à
ajo
al
ala
alla
and
as
at
au
aux
avec
but
by
coi
con
d
de
des
di
du
due
e
el
en
estilo
et
eze
for
from
für
i
in
into
l
la
like
med
mit
nor
o
of
on
onto
or
ou
para
past
per
plus
s
so
su
sur
the
to
un
up
upon
v
vagy
w
with
y
yet
z
ze


Regards,
Flo

Messages 19756 - 19785 of 23891   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help