kor Posted March 31, 2011 Share Posted March 31, 2011 #include <File.au3> #include <array.au3> Dim $array[13] ;_FileReadToArray($file, $array) $array[0] = "X-GWRECORDID:4C4AE09E.DIST_DOMAIN.DIST_PO.100.1647274.1.2553.1" $array[1] = "ORGANIZER;CN=aname;ROLE=CHAIR:MAILTO:somename@email.com" $array[2] = "ATTENDEE;CN=aname;ROLE=REQ-PARTICIPANT:MAILTO:somename@email.com" $array[3] = "ATTENDEE;CN=aname;ROLE=REQ-PARTICIPANT:" $array[4] = "MAILTO:jjohn@email.com" $array[5] = "ATTENDEE;CN=John John;ROLE=REQ-PARTICIPANT:" $array[6] = "MAILTO:somename@email.com" $array[7] = "DESCRIPTION:" $array[9] = "DTEND:20100728T193000Z" $array[10] = "LOCATION:A good place" $array[11] = "SEQUENCE:7" $array[12] = "UID:20100724T194610Z_C0EF0025@email.com" $result = StringRegExp($array[4], "email.com") consolewrite($result & @CR) StringRegExpReplace($array[4], "email.com", "differentemail.com") consolewrite($array[4] & @CR) Having problems replacing parts of items inside array rows. Link to comment Share on other sites More sharing options...
Malkey Posted March 31, 2011 Share Posted March 31, 2011 You need to assign the variable. $array[4] = StringRegExpReplace($array[4], "email.com", "differentemail.com") Link to comment Share on other sites More sharing options...
sahsanu Posted March 31, 2011 Share Posted March 31, 2011 Having problems replacing parts of items inside array rows. As Malkey said: #include <File.au3> #include <array.au3> Dim $array[13] ;_FileReadToArray($file, $array) $array[0] = "X-GWRECORDID:4C4AE09E.DIST_DOMAIN.DIST_PO.100.1647274.1.2553.1" $array[1] = "ORGANIZER;CN=aname;ROLE=CHAIR:MAILTO:somename@email.com" $array[2] = "ATTENDEE;CN=aname;ROLE=REQ-PARTICIPANT:MAILTO:somename@email.com" $array[3] = "ATTENDEE;CN=aname;ROLE=REQ-PARTICIPANT:" $array[4] = "MAILTO:jjohn@email.com" $array[5] = "ATTENDEE;CN=John John;ROLE=REQ-PARTICIPANT:" $array[6] = "MAILTO:somename@email.com" $array[7] = "DESCRIPTION:" $array[8] = "Where was it? ;-)" $array[9] = "DTEND:20100728T193000Z" $array[10] = "LOCATION:A good place" $array[11] = "SEQUENCE:7" $array[12] = "UID:20100724T194610Z_C0EF0025@email.com" For $i=0 to UBound($array)-1 $array[$i]=StringRegExpReplace($array[$i], "email.com", "differentemail.com") Next _ArrayDisplay($array) Link to comment Share on other sites More sharing options...
kor Posted April 1, 2011 Author Share Posted April 1, 2011 got it. Thanks guys! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now