[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: cwd in U2



Reply to note from Judith Davidsen  Wed, 16
Jan 2002 16:39:03 -0500

> I've been using cwd  for a couple of days now and it's
> a godsend--much quicker and more accurate than a manual count
> of repeated words using se, and way easier on the
> hand/wrist/arm etc.
>
> However, is there some switch I can add that will count partial
> words, e.g., scot whether it appears in scott or scotch or
> ascot?

In other words, you want to count strings instead of words? That's
an easy modification. DECODE the following and plug it in. You
know the drill. Don't SAve U2; rather, issue LH, then
ABort the file.

To count strings, issue CWD/S. To conserve memory, I've
eliminated the longer framename COUNTWD.

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5cwd,cwd/s}} Count occurrences of a WorD or STring [CLD re
v. 1/16/02][cr|lf]{2}{<}IF{<}VA$WS{>}<>1{>}{<}PRNo file{>}{<}
EX{>}{<}EI{>}{<}SX01,{<}VA$WA{>}{>}{<}IF{<}PV01{>}<1{>}{<}PRN
o window{>}{<}EX{>}{<}EI{>}[XH_][BX_]es 1[Q2_][DX_]{<}SV02,{>
}{<}IF""""{238}{<}IS50{>}==0{>}{<}SX50,{<}VA@50"2{>}{>}{<}SV0
2,a{>}{<}GLa{>}{<}EI{>}{<}SX50,@upr({<}IS50{>}){>};*;[cr|lf]{
<}LBa{>}{<}SU03,{>}[DZ_]{<}IF{<}VA$DE{>}<1{>}{<}SX04,{<}CP{>}
{>}[TF_][DF_][BF_][DF_][BX_]jmp {<}PV04{>}[Q2_]{<}SU03,[YD_]{
>}{<}EI{>}[BX_]func #{<}PV01{>}[Q2_][BX_]ne/100[Q2_][CP_];*;[
cr|lf][BX_]ch{<}PV02{>}/t{<}IF"S"{238}@upr({<}VA$FR{>})<0{>}/
w{<}EI{>} [999]{<}PV50{>}[999]{<}PV50{>}[999][Q2_]{<}SX01,{<}
VA$WC{>}{>}{<}IF{<}VA|02{>}>0{>}{<}SX50,""""+{<}IS50{>}+"""{>
}{<}EI{>}{<}SX05,{<}IS01{>}+" occurrence(s) of "{>}{<}IF@upr(
{<}VA$FR{>}){240}"S"{>}{<}SX05,{<}is05{>}+"string "{>}{<}EI{>
}{<}SX05,{<}is05{>}+{<}IS50{>}{>}{<}SX01,{<}VA$WN{>}{>}[BX_]a
b/nv[Q2_]{<}IF{<}VA$WN{>}=={<}PV01{>}{>}[BX_]rs[Q2_]{<}EI{>}{
<}GT03{>}{<}PR@05{>}{<}EX{>}{2}[cr|lf][cr|lf]
-nd
XPLeNCODE

--
Carl Distefano
cld@xxxxxxxx
http://users.datarealm.com/xywwweb/