Okay, so, after looking at this again, I don't think it will work this way.
You need to add the result of the two STRSTR commands together, so you
cannot nest it as shown.

$IP$ = 126.0.0.1
'FirstDot' = STRSTRC($IP$, .)                      // $FirstDot$ = 3
'TmpIP' = SUBSTRC($IP$, ($FirstDot' + 1))          // $TmpIP$ = 0.0.1
'SecondDot' = STRSTRC($TmpIP$, .)                  // $SecondDot$ = 1
'IndexSecondDot' = $SecondDot$ + $FirstDot$ + 1    // the +1 is for the
actual dot itself.

Now, take 'ShownIP' = SUBSTRC($IP$, 0, $IndexSecondDot$) to get the first
two octets only, this should include the dot at the end of the second octet.
So, you would see $ShownIP$ = 126.0. and then you can just append x.x to it.

Thanks,


Gary Opela, Jr

Sr. Remedy Developer

Leader Communications, Inc.

405 736 3211

-----Original Message-----
From: Opela, Gary L Contr OC-ALC/ITMA 
Sent: Monday, December 10, 2007 9:21 AM
To: '[email protected]'
Subject: RE: How to partially mask a field

Fun stuff here.

To find the index of the second period:

$IP$ = 126.0.0.1
$FirstOct$ = STRSTR($IP$, .)
$TmpIP$ = SUBSTR($IP$, $FirstOct$)
$SecondOct$ = STRSTR($TmpIP$, .)

Nested:

$SecondOct$ = STRSTR((SUBSTR($IP$, (STRSTR($IP$, .)), .)    [I think]

Now, to mask, you can simply set a field to SUBSTR($IP$, 0, $SecondOct$) and

it will just show the first two octets. You might have to add or remove 1 on

some of the SUBSTR commands.

SO, total, nested would be:

'ShownIP' = SUBSTR($IP$, 0, (STRSTR((SUBSTR($IP$, (STRSTR($IP$, .)), .)))

And again, you might need to add or subtract 1 here and there.


Thanks,


Gary Opela, Jr

Sr. Remedy Developer

Leader Communications, Inc.

405 736 3211

-----Original Message-----
From: Action Request System discussion list(ARSList) 
[mailto:[EMAIL PROTECTED] On Behalf Of Joran, Peter P, CTR, OSD-CIO
Sent: Monday, December 10, 2007 9:00 AM
To: [email protected]
Subject: How to partially mask a field

All

I need to mask the first two octets of our IP addresses. It gets a little 
complicated as an IP address length varies. For example an
IP address could be 1.1.1.1 or 123.123.123.123. Is there a way to do a
SUBSTR 
type of function that can start after the second "."?
I'm trying to avoid reformatting the address to eventually get what I want.

Then again if I'm going about this the wrong way I'm open to thoughts.

Best Regards
Pete

____________________________________________________________________________
___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to