Page 1 of 1 1
Topic Options
#126997 - 2004-09-23 03:25 PM how to cut in a string
jan Offline
Getting the hang of it

Registered: 2004-07-07
Posts: 66
Hi,

I have a string:
test1#teste#testesen#dkbirfs01;MF Skrivebord users;MF Orion;dbbpc

I want to cut everything before ";" and then split the rest. After ; there can be serveral ;

Hope I have explained my problem clearly

Jan

Top
#126998 - 2004-09-23 03:35 PM Re: how to cut in a string
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you mean something like:
split(substr($string,instr($string,";")),";")

or ?
_________________________
!

download KiXnet

Top
#126999 - 2004-09-23 03:35 PM Re: how to cut in a string
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
There is more than one ";" so you have not explained well enough for me at least. Maybe others with better clairvoyance understand.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#127000 - 2004-09-23 04:02 PM Re: how to cut in a string
jan Offline
Getting the hang of it

Registered: 2004-07-07
Posts: 66
Sorry

I have a script that creates users using a txt-file. I creates users perfectly but when I want to add groups to the users it goes wrong. Everything after ; is groups in my AD the users should be added

Here is part of my code:

$NULL=Open(1,"c:\scripts\users.txt")
$result=ReadLine(1)
$uarray=SPLIT($result,";")
? "uarray: $uarray"
FOR EACH $i IN $uarray
? "FOR i: $i"
; $objuser.memberof="cn="+$i+ "ou=groups,"+ $domain
$objUser.SetInfo
$objUser = ""
NEXT

Top
#127001 - 2004-09-23 04:17 PM Re: how to cut in a string
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
I'm still not too clear on what you are up to, but if you just want to ignore the first field this should do:
Code:
$NULL=Open(1,"c:\scripts\users.txt")

$result=ReadLine(1)
$uarray=SPLIT($result,";")
$uarray[0]=""
FOR EACH $i IN $uarray
If $i
"FOR i: $i" ?
EndIf
NEXT


Top
#127002 - 2004-09-23 04:56 PM Re: how to cut in a string
jan Offline
Getting the hang of it

Registered: 2004-07-07
Posts: 66
Problem solved

Thanks

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 507 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.054 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org