RE: [U2] [UV] Processing a string
an alternative approach would be to write your string once-off to a sequential file, then do READBLK's of one char in a loop... READBLK's work at an amazing rate -Original Message- From: Nick Cipollina [mailto:[EMAIL PROTECTED] Sent: Wednesday, 15 September, 2004 2:32 PM To: [EMAIL PROTECTED] Subject: [U2] [UV] Processing a string What is the fastest way to process a long string byte by byte. I want to know if there is a faster way to do the following: STR.VAR = "Some really really long string that has lots and lots of characters for test processing." MAX.STR = LEN(STR.VAR) FOR X = 1 TO MAX.STR VAR = STR.VAR[X,1] do stuff with VAR here . NEXT X Thanks in advance. Nick Cipollina Pick Programmer ACS - Heritage Information Systems, Inc. 2810 North Parham Road, Suite 210 Richmond, VA 23294 (804)644-8707 x 314 --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ - GWK BEPERK/LIMITED (REG: 1997/022252/06) POSBUS 47 PO BOX 8730 DOUGLAS Direkteure/Directors: NB Jacobs, FJ Lawrence, J v/d S Botes, JH Coetzee, JGD Smit, JF Jacobs, AO M|ller, JW Smit, JP Snyman, JG Stander, JH van Dyk(MD/BD), JG Jacobs, A M|ller, M van Zyl, Sekr/Secr: E van Niekerk. Hierdie e-pos is onderworpe aan 'n vrywaring beskikbaar by: http://www.gwk.co.za/DisclaimerVrywaring.asp This e-mail is subjected to the disclaimer that can be viewed at: http://www.gwk.co.za/DisclaimerVrywaring.asp --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
You're right about url encoding and forms. However, binary transmissions have nothing to with HTML or XML. Binary has to be transmitted via HTTP under specific MIME headers, so the web server/application won't try to parse it as text. My rule of thumb is, don't stick protected characters in text content, unless you're SURE it won't get parsed incorrectly. A sure bet that it won't get messed up, is inside a block for example. Sure, you can use ">" and "<" anywhere you want, provided you don't break the cardinal rules. Try this on for size: Then try: < blah /> and finally: <blah/> According to what I've been reading, all 3 of the above should display the string "". However, option 1 breaks the rules by not having white space or "!" after "<" to identify that it's not an HTML element. Since there is a "/" before the ">", the parser thinks it's a self-closing tag. In this case, you will have to encode the string with either hex values or "&" representations. On a side note, my XML subroutine will only extract tags and content between matching pairs. "<>" will be included in any wrapping elements, unless there is a matching "". Self-closing tags are handled differently, due to their syntax difference. Is it 100% fool proof? No, it's not a commercially developed application. It does a good job though. <> will return <> as the element content for "TAG". <> will return "TAG" as null and delete the "" tag pair. wil return TAG = 1. Glen http://picksource.com > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Craig Bennett > Sent: Thursday, September 16, 2004 7:34 PM > To: [EMAIL PROTECTED] > Subject: Re: [U2] [UV] Processing a string > > > Glen, > > > Per HTTP 1.0-1.2 specifications, ">" and "<" are not exempt > from content > > encoding requirements. They are protected characters and must > be treated as > > such when sending content. Light bulb going off yet? > Surely you don't mean the HTTP specifications? (Which the W3 have > officially closed at HTTP/1.1). > > > If you must use a ">" or "<" character as a non-elemental string, in > > ANY > > media, transferred through an HTTP 1.0 to 1.2 compliant application > > then you > > MUST URL-encode them as <, > or their equiv. charset hex values > > as > > %XX;. Comments are an exception to this rule, but you can still have > > problems with general parsing if you put protected characters in the > > comments. I always url-encode my non-alpha-numeric strings. > > You do not have to URL encode these characters at all, otherwise you > could never send XML or indeed binary data over HTTP (image/jpeg). > > If you are sending a body with a specific content then encoding rules > will apply, but these are defined by other standards. Perhaps you are > thinking of the HTML standards for POSTING data using the > application/x-www-form-urlencoded content type? > > > Craig > --- > u2-users mailing list > [EMAIL PROTECTED] > To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [UV] Processing a string
Glen, Per HTTP 1.0-1.2 specifications, ">" and "<" are not exempt from content encoding requirements. They are protected characters and must be treated as such when sending content. Light bulb going off yet? Surely you don't mean the HTTP specifications? (Which the W3 have officially closed at HTTP/1.1). > If you must use a ">" or "<" character as a non-elemental string, in > ANY > media, transferred through an HTTP 1.0 to 1.2 compliant application > then you > MUST URL-encode them as <, > or their equiv. charset hex values > as > %XX;. Comments are an exception to this rule, but you can still have > problems with general parsing if you put protected characters in the > comments. I always url-encode my non-alpha-numeric strings. You do not have to URL encode these characters at all, otherwise you could never send XML or indeed binary data over HTTP (image/jpeg). If you are sending a body with a specific content then encoding rules will apply, but these are defined by other standards. Perhaps you are thinking of the HTML standards for POSTING data using the application/x-www-form-urlencoded content type? Craig --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
This gets better and better every day. *LOL* Per HTTP 1.0-1.2 specifications, ">" and "<" are not exempt from content encoding requirements. They are protected characters and must be treated as such when sending content. Light bulb going off yet? If you must use a ">" or "<" character as a non-elemental string, in ANY media, transferred through an HTTP 1.0 to 1.2 compliant application then you MUST URL-encode them as <, > or their equiv. charset hex values as %XX;. Comments are an exception to this rule, but you can still have problems with general parsing if you put protected characters in the comments. I always url-encode my non-alpha-numeric strings. Glen http://picksource.com > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of David Beahm > Sent: Thursday, September 16, 2004 10:16 AM > To: [EMAIL PROTECTED] > Subject: Re: [U2] [UV] Processing a string > > > I agree, inside of a tag the Unicode equivalent is, if not required, > certainly prudent: > > > > Think outside the tag. ;) > > Consider: > > "here's some text saying 2 < 3 > 2" > > If you FIELD() or EREPLACE or whatever on "<" or ">" then you're going > to have problems when a document contains them in text. > > > 2.2 Characters > > [Definition: A parsed entity contains text, a sequence of characters, > which may represent markup or character data.] [Definition: A character > is an atomic unit of text as specified by ISO/IEC 10646:2000 [ISO/IEC > 10646]. Legal characters are tab, carriage return, line feed, and the > legal characters of Unicode and ISO/IEC 10646. The versions of these > standards cited in A.1 Normative References were current at the time > this document was prepared. New characters may be added to these > standards by amendments or new editions. Consequently, XML processors > MUST accept any character in the range specified for Char. ] > > > Ref: http://www.w3.org/TR/2004/REC-xml-20040204/ > > Best, > David Beahm > > Kevin King wrote: > > > Is it not against the XML standard to have a quoted string containing > > "<" or ">" in a tag? > --- > u2-users mailing list > [EMAIL PROTECTED] > To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [UV] Processing a string
David, It kinda depends where the document originated. SOAP won't allow that - it requires that you always escape (if you follow the SOAP 1.2 specification) here's some text saying 2 < 3 > Brian On Thu, 16 Sep 2004 10:16:18 -0400 David Beahm <[EMAIL PROTECTED]> wrote: >I agree, inside of a tag the Unicode equivalent is, if not required, certainly >prudent: > > > >Think outside the tag. ;) > >Consider: > >"here's some text saying 2 < 3 > 2" > >If you FIELD() or EREPLACE or whatever on "<" or ">" then you're going to have >problems >when a document contains them in text. > > >2.2 Characters > >[Definition: A parsed entity contains text, a sequence of characters, which may >represent markup or character data.] [Definition: A character is an atomic unit of >text >as specified by ISO/IEC 10646:2000 [ISO/IEC 10646]. Legal characters are tab, carriage >return, line feed, and the legal characters of Unicode and ISO/IEC 10646. The versions >of these standards cited in A.1 Normative References were current at the time this >document was prepared. New characters may be added to these standards by amendments or >new editions. Consequently, XML processors MUST accept any character in the range >specified for Char. ] > > >Ref: http://www.w3.org/TR/2004/REC-xml-20040204/ > >Best, >David Beahm > >Kevin King wrote: > >>Is it not against the XML standard to have a quoted string containing >>"<" or ">" in a tag? >--- >u2-users mailing list >[EMAIL PROTECTED] >To unsubscribe please visit http://listserver.u2ug.org/ > > >This email was checked by MessageLabs SkyScan before entering Microgen. This email was checked on leaving Microgen for viruses, similar malicious code and inappropriate content by MessageLabs SkyScan. DISCLAIMER This email and any attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information. In the event of any technical difficulty with this email, please contact the sender or [EMAIL PROTECTED] Microgen Information Management Solutions http://www.microgen.co.uk --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [UV] Processing a string
I agree, inside of a tag the Unicode equivalent is, if not required, certainly prudent: Think outside the tag. ;) Consider: "here's some text saying 2 < 3 > 2" If you FIELD() or EREPLACE or whatever on "<" or ">" then you're going to have problems when a document contains them in text. 2.2 Characters [Definition: A parsed entity contains text, a sequence of characters, which may represent markup or character data.] [Definition: A character is an atomic unit of text as specified by ISO/IEC 10646:2000 [ISO/IEC 10646]. Legal characters are tab, carriage return, line feed, and the legal characters of Unicode and ISO/IEC 10646. The versions of these standards cited in A.1 Normative References were current at the time this document was prepared. New characters may be added to these standards by amendments or new editions. Consequently, XML processors MUST accept any character in the range specified for Char. ] Ref: http://www.w3.org/TR/2004/REC-xml-20040204/ Best, David Beahm Kevin King wrote: Is it not against the XML standard to have a quoted string containing "<" or ">" in a tag? --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [UV] Processing a string
Sorry that's not correct. Comments have to be delimited just like everything else. I did not say you can ignore what the tag says. I only said you can use "<" and ">" to find the tag. If a tag starts with "!" then it requires special processing. Apologies Will, I didn't mean to verbal you, just point out that once you see a
Re: [U2] [UV] Processing a string
In a message dated 9/15/2004 5:24:31 PM Pacific Daylight Time, [EMAIL PROTECTED] writes: > So just working on fields will fail if there are any of these in the XML. > > So you cannot rely on < and > as delimiters. Sorry that's not correct. Comments have to be delimited just like everything else. I did not say you can ignore what the tag says. I only said you can use "<" and ">" to find the tag. If a tag starts with "!" then it requires special processing. Will --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [UV] Processing a string
Is it not against the XML standard to have a quoted string containing "<" or ">" in a tag? You can certainly have comments like this in valid XML And processing instructions <> ?> And CDATA Sections (I forget the format, but they can hold arbitrary binary data). So just working on fields will fail if there are any of these in the XML. So you cannot rely on < and > as delimiters. Craig --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [UV] Processing a string
Hi Nick, If you are on UV I have found a combination of BYTEVAL and computed GOSUBS to be the fastest way to process a string in BASIC character by character. Model your parser as a state machine and each state becomes CC = BYTEVAL(XMLSTRING, POS) POS += 1 ON CC + 2 GOSUB ENDOFSTRING, HANDLECHAR0, HANDLECHAR1, etc. This will get more complex if you need to handle UTF8 characters but it is definitely faster than CC = XMLSTRING[POS, 1] and then testing CC (I don't know how performance will be affected if you need to handle multi byte characters). I think I posted some benchmarks a few years ago, but I could be wrong. The code is verbose, but obvious. Craig --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
Is it not against the XML standard to have a quoted string containing "<" or ">" in a tag? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Beahm Sent: Wednesday, September 15, 2004 4:04 PM To: [EMAIL PROTECTED] Subject: Re: [U2] [UV] Processing a string Will- Wouldn't that cause a problem if there are quoted strings containing < or > characters? That's why I went character by character in my XML routine. As someone else pointed out, handling truly large strings efficiently usually comes down to not loading the entire thing into memory at once. The underlying string routines are quite efficient, but everything suffers if memory gets too crowded and the system starts swapping. Best, David Beahm [EMAIL PROTECTED] wrote: > "I've got a subroutine that takes an XML string and tries to convert it > into a dynamic array. It does it byte by byte, and I'm just looking for > a faster way to parse the XML." > > Nick, someone already alluded to this but you can probably make it faster by extracting information FIELD by FIELD instead of char by char. XML is a delimited language, delimited by whatever "tag" might be. > > So you do an INDEX on "<" and it returns the char position where the "<" is. You can then INDEX on ">" and it returns the char position where the ">" is. Now you know what the tag starts and stops. > > *C.DELIM is a counter to how many delims I've already run through > START.POS = INDEX(mystring,"<",C.DELIM) > STOP.POS = INDEX(mystring,">",C.DELIM) > THIS.TAG = mystring[START.POS+1,STOP.POS-START.POS-1] > > You can do a similiar thing to find the fields of data between the tags. Using index and sub-string extraction should be faster than extracting and testing every single char. > > Will Johnson > Fast Forward --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [UV] Processing a string
Will- Wouldn't that cause a problem if there are quoted strings containing < or > characters? That's why I went character by character in my XML routine. As someone else pointed out, handling truly large strings efficiently usually comes down to not loading the entire thing into memory at once. The underlying string routines are quite efficient, but everything suffers if memory gets too crowded and the system starts swapping. Best, David Beahm [EMAIL PROTECTED] wrote: "I've got a subroutine that takes an XML string and tries to convert it into a dynamic array. It does it byte by byte, and I'm just looking for a faster way to parse the XML." Nick, someone already alluded to this but you can probably make it faster by extracting information FIELD by FIELD instead of char by char. XML is a delimited language, delimited by whatever "tag" might be. So you do an INDEX on "<" and it returns the char position where the "<" is. You can then INDEX on ">" and it returns the char position where the ">" is. Now you know what the tag starts and stops. *C.DELIM is a counter to how many delims I've already run through START.POS = INDEX(mystring,"<",C.DELIM) STOP.POS = INDEX(mystring,">",C.DELIM) THIS.TAG = mystring[START.POS+1,STOP.POS-START.POS-1] You can do a similiar thing to find the fields of data between the tags. Using index and sub-string extraction should be faster than extracting and testing every single char. Will Johnson Fast Forward --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
"I've got a subroutine that takes an XML string and tries to convert it into a dynamic array. It does it byte by byte, and I'm just looking for a faster way to parse the XML." Nick, someone already alluded to this but you can probably make it faster by extracting information FIELD by FIELD instead of char by char. XML is a delimited language, delimited by whatever "tag" might be. So you do an INDEX on "<" and it returns the char position where the "<" is. You can then INDEX on ">" and it returns the char position where the ">" is. Now you know what the tag starts and stops. *C.DELIM is a counter to how many delims I've already run through START.POS = INDEX(mystring,"<",C.DELIM) STOP.POS = INDEX(mystring,">",C.DELIM) THIS.TAG = mystring[START.POS+1,STOP.POS-START.POS-1] You can do a similiar thing to find the fields of data between the tags. Using index and sub-string extraction should be faster than extracting and testing every single char. Will Johnson Fast Forward --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
Nick, are you sure the bottleneck isn't the storage part of your subroutine? Stuffing large amounts of data into a dynamic array can be slow. --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
Then a different ACS probably. I'm Thinking American Computer Sevices, and chances are a differnt Nick.. George >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] >Sent: Wednesday, September 15, 2004 1:09 PM >To: [EMAIL PROTECTED] >Subject: RE: [U2] [UV] Processing a string > > >Probably, ACS has a presence in almost every major city in the country. > >Thanks, > >Nick Cipollina > > >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of George Gallen >Sent: Wednesday, September 15, 2004 11:22 AM >To: [EMAIL PROTECTED] >Subject: RE: [U2] [UV] Processing a string > >I thought that UV10 had support for XML? > >I havn't used it, so I don't know how to go about it. > >Also, you could always try sending it off to PERL routine >to parse, then give it back to UV. > >George > >PS. Nick, Are you from the Phila area? and is the ACS the >same ACS from Malvern? > >>-Original Message- >>From: [EMAIL PROTECTED] >>[mailto:[EMAIL PROTECTED] >>Sent: Wednesday, September 15, 2004 10:48 AM >>To: [EMAIL PROTECTED] >>Subject: RE: [U2] [UV] Processing a string >> >> >>I'm trying to parse some very long XML code. If I do it byte by byte >>this way, it is taking a very long time to parse. We are >>trying to find >>a faster way to parse it. >> >>Thanks, >> >>Nick Cipollina >> >>-Original Message- >>From: [EMAIL PROTECTED] >>[mailto:[EMAIL PROTECTED] On Behalf Of >>Adrian Matthews >>Sent: Wednesday, September 15, 2004 8:59 AM >>To: [EMAIL PROTECTED] >>Subject: RE: [U2] [UV] Processing a string >> >>Depends what you're trying to achieve I suppose. If it's for >a checksum >>then there are commands to do that. If it's looking for occurrences of >>text then there are commands to do that as well. >> >>If you have to step through a character at a time then that >looks about >>the best way of doing it to me. >> >>-Original Message- >>From: [EMAIL PROTECTED] >>[mailto:[EMAIL PROTECTED] On Behalf Of Nick >Cipollina >>Sent: 15 September 2004 13:32 >>To: [EMAIL PROTECTED] >>Subject: [U2] [UV] Processing a string >> >>What is the fastest way to process a long string byte by byte. I want >>to know if there is a faster way to do the following: >> >> >> >>STR.VAR = "Some really really long string that has lots and lots of >>characters for test processing." >> >>MAX.STR = LEN(STR.VAR) >> >>FOR X = 1 TO MAX.STR >> >>VAR = STR.VAR[X,1] >> >>do stuff with VAR here . >> >>NEXT X >> >> >> >>Thanks in advance. >> >> >> >>Nick Cipollina >> >> >> >>Pick Programmer >> >>ACS - Heritage Information Systems, Inc. >> >>2810 North Parham Road, Suite 210 >> >>Richmond, VA 23294 >> >>(804)644-8707 x 314 >>--- >>u2-users mailing list >>[EMAIL PROTECTED] >>To unsubscribe please visit http://listserver.u2ug.org/ >> >> >>The information contained in this email is strictly >>confidential and for >>the use of the addressee only, unless otherwise indicated. If you are >>not the intended recipient, please do not read, copy, use or >>disclose to >>others this message or any attachment. Please also notify the >sender by >>replying to this email or by telephone +44 (0)20 7896 0011 and then >>delete the email and any copies of it. Opinions, conclusions >>(etc.) that >>do not relate to the official business of this company shall be >>understood as neither given nor endorsed by it. IG Markets >Limited and >>IG Index Plc are authorised and regulated by the Financial Services >>Authority and, in Australia, by the Australian Securities and >>Investments Commission. >>--- >>u2-users mailing list >>[EMAIL PROTECTED] >>To unsubscribe please visit http://listserver.u2ug.org/ >>--- >>u2-users mailing list >>[EMAIL PROTECTED] >>To unsubscribe please visit http://listserver.u2ug.org/ >--- >u2-users mailing list >[EMAIL PROTECTED] >To unsubscribe please visit http://listserver.u2ug.org/ >--- >u2-users mailing list >[EMAIL PROTECTED] >To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
I've got a subroutine that takes an XML string and tries to convert it into a dynamic array. It does it byte by byte, and I'm just looking for a faster way to parse the XML. Thanks, Nick Cipollina -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Reid Sent: Wednesday, September 15, 2004 1:22 PM To: '[EMAIL PROTECTED]' Subject: RE: [U2] [UV] Processing a string I don't suppose that the type of problem being solved could be delved into a bit more? There are a ton of string routines that I have found useful, but they seem to be solutions waiting for a problem to solve, in this case. j -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adrian Matthews Sent: Wednesday, September 15, 2004 10:11 AM To: [EMAIL PROTECTED] Subject: RE: [U2] [UV] Processing a string I've used that in the past for parsing strings that are several hundred thousand chars in length but there's no significant difference until then. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Glenn Herbert Sent: 15 September 2004 14:22 To: [EMAIL PROTECTED] Subject: Re: [U2] [UV] Processing a string You could fold the string into a dynamic array and use remove: STR.VAR= "Some really really long string that has lots and lots of characters for test processing." FOLDED.VAR=FOLD(STR.VAR,1); *creates dynarray of single characters LOOP REMOVE ACHAR FROM FOLDED.VAR SETTING MARK UNTIL NOT(MARK) and ACHAR="" DO * any character processing on ACHAR REPEAT I'm not sure of any actual performance gain compared with simply STR.VAR[x,1] but it's at least an alternate approach. At 08:31 AM 9/15/2004, you wrote: >What is the fastest way to process a long string byte by byte. I want >to know if there is a faster way to do the following: --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone +44 (0)20 7896 0011 and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Markets Limited and IG Index Plc are authorised and regulated by the Financial Services Authority and, in Australia, by the Australian Securities and Investments Commission. --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
I don't suppose that the type of problem being solved could be delved into a bit more? There are a ton of string routines that I have found useful, but they seem to be solutions waiting for a problem to solve, in this case. j -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adrian Matthews Sent: Wednesday, September 15, 2004 10:11 AM To: [EMAIL PROTECTED] Subject: RE: [U2] [UV] Processing a string I've used that in the past for parsing strings that are several hundred thousand chars in length but there's no significant difference until then. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Glenn Herbert Sent: 15 September 2004 14:22 To: [EMAIL PROTECTED] Subject: Re: [U2] [UV] Processing a string You could fold the string into a dynamic array and use remove: STR.VAR= "Some really really long string that has lots and lots of characters for test processing." FOLDED.VAR=FOLD(STR.VAR,1); *creates dynarray of single characters LOOP REMOVE ACHAR FROM FOLDED.VAR SETTING MARK UNTIL NOT(MARK) and ACHAR="" DO * any character processing on ACHAR REPEAT I'm not sure of any actual performance gain compared with simply STR.VAR[x,1] but it's at least an alternate approach. At 08:31 AM 9/15/2004, you wrote: >What is the fastest way to process a long string byte by byte. I want >to know if there is a faster way to do the following: --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone +44 (0)20 7896 0011 and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Markets Limited and IG Index Plc are authorised and regulated by the Financial Services Authority and, in Australia, by the Australian Securities and Investments Commission. --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
Look at the XML parser subs on my site. I basically broke a document variable down into an array by the ending and leading "<" ">" tags using CONVERT. It makes no difference if the document variable is a single string or an array of strings. You can also use this to parse plain ole HTML documents(tho it could be a nightmare actually using the results). You can replace the CONVERT function with SWAP, if you don't have it available on your flavor. The data is set into 3 variables. The element name, attribute, and value are separated for LOCATE use and such. I know of several people using it for live document parsing. One site member has submitted changes and updates to it, so there are several versions of it. The "XML Parser Sub" will skip a preset number of nesting levels, if you're parsing a consistent DTD and know you can skip the headers. This will speed up your process greatly. On the flipside, I've been using the barbaric version to break down cXML documents from Ariba Network. It's quite fast, even in its barbaric form. Too bad our customer decided not to use Shopping PunchOut, after integrating it into our business software and web site. :/ http://www.picksource.com/modules.php?name=Downloads&d_op=viewdownload&cid=1 0 This subroutine will be included in the future release of MVWWW, with an XML handling module. You'll be able to call your own app using your own XML document, or specify an app to run based on an element value pair. It's not node traversing or storing technology, but it does break the data down into MV data you can easily use. Of course, you'll need to know the DTD or XML format in order to write any decent applications. Mapping technology is a future project. Glen http://picksource.com > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Nick > Cipollina > Sent: Wednesday, September 15, 2004 8:48 AM > To: [EMAIL PROTECTED] > Subject: RE: [U2] [UV] Processing a string > > I'm trying to parse some very long XML code. If I do it byte by byte > this way, it is taking a very long time to parse. We are trying to > find a faster way to parse it. > > Thanks, > > Nick Cipollina > To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
Probably, ACS has a presence in almost every major city in the country. Thanks, Nick Cipollina -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of George Gallen Sent: Wednesday, September 15, 2004 11:22 AM To: [EMAIL PROTECTED] Subject: RE: [U2] [UV] Processing a string I thought that UV10 had support for XML? I havn't used it, so I don't know how to go about it. Also, you could always try sending it off to PERL routine to parse, then give it back to UV. George PS. Nick, Are you from the Phila area? and is the ACS the same ACS from Malvern? >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] >Sent: Wednesday, September 15, 2004 10:48 AM >To: [EMAIL PROTECTED] >Subject: RE: [U2] [UV] Processing a string > > >I'm trying to parse some very long XML code. If I do it byte by byte >this way, it is taking a very long time to parse. We are >trying to find >a faster way to parse it. > >Thanks, > >Nick Cipollina > >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of >Adrian Matthews >Sent: Wednesday, September 15, 2004 8:59 AM >To: [EMAIL PROTECTED] >Subject: RE: [U2] [UV] Processing a string > >Depends what you're trying to achieve I suppose. If it's for a checksum >then there are commands to do that. If it's looking for occurrences of >text then there are commands to do that as well. > >If you have to step through a character at a time then that looks about >the best way of doing it to me. > >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of Nick Cipollina >Sent: 15 September 2004 13:32 >To: [EMAIL PROTECTED] >Subject: [U2] [UV] Processing a string > >What is the fastest way to process a long string byte by byte. I want >to know if there is a faster way to do the following: > > > >STR.VAR = "Some really really long string that has lots and lots of >characters for test processing." > >MAX.STR = LEN(STR.VAR) > >FOR X = 1 TO MAX.STR > >VAR = STR.VAR[X,1] > >do stuff with VAR here . > >NEXT X > > > >Thanks in advance. > > > >Nick Cipollina > > > >Pick Programmer > >ACS - Heritage Information Systems, Inc. > >2810 North Parham Road, Suite 210 > >Richmond, VA 23294 > >(804)644-8707 x 314 >--- >u2-users mailing list >[EMAIL PROTECTED] >To unsubscribe please visit http://listserver.u2ug.org/ > > >The information contained in this email is strictly >confidential and for >the use of the addressee only, unless otherwise indicated. If you are >not the intended recipient, please do not read, copy, use or >disclose to >others this message or any attachment. Please also notify the sender by >replying to this email or by telephone +44 (0)20 7896 0011 and then >delete the email and any copies of it. Opinions, conclusions >(etc.) that >do not relate to the official business of this company shall be >understood as neither given nor endorsed by it. IG Markets Limited and >IG Index Plc are authorised and regulated by the Financial Services >Authority and, in Australia, by the Australian Securities and >Investments Commission. >--- >u2-users mailing list >[EMAIL PROTECTED] >To unsubscribe please visit http://listserver.u2ug.org/ >--- >u2-users mailing list >[EMAIL PROTECTED] >To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [UV] Processing a string
Is using a sequential file out of the question? I just modified our output browser to use sequential files, and it wasn't anywhere near as hard as I had feared, and that had to support moving up and down through the data. XML should be a one-way trip, making it downright simple. This change made it possible to browse report output that was too big for memory. OTOH, you could also use Java.. Best, David Beahm Nick Cipollina wrote: I'm trying to parse some very long XML code. If I do it byte by byte this way, it is taking a very long time to parse. We are trying to find a faster way to parse it. Thanks, Nick Cipollina --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
Here's a thought: Break the code into lines and then parse each line independently. The more you break it down into smaller pieces, the faster the substring extraction will be because there'll be less characters to scan. -Kevin [EMAIL PROTECTED] http://www.PrecisOnline.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nick Cipollina Sent: Wednesday, September 15, 2004 8:48 AM To: [EMAIL PROTECTED] Subject: RE: [U2] [UV] Processing a string I'm trying to parse some very long XML code. If I do it byte by byte this way, it is taking a very long time to parse. We are trying to find a faster way to parse it. Thanks, Nick Cipollina -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adrian Matthews Sent: Wednesday, September 15, 2004 8:59 AM To: [EMAIL PROTECTED] Subject: RE: [U2] [UV] Processing a string Depends what you're trying to achieve I suppose. If it's for a checksum then there are commands to do that. If it's looking for occurrences of text then there are commands to do that as well. If you have to step through a character at a time then that looks about the best way of doing it to me. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nick Cipollina Sent: 15 September 2004 13:32 To: [EMAIL PROTECTED] Subject: [U2] [UV] Processing a string What is the fastest way to process a long string byte by byte. I want to know if there is a faster way to do the following: STR.VAR = "Some really really long string that has lots and lots of characters for test processing." MAX.STR = LEN(STR.VAR) FOR X = 1 TO MAX.STR VAR = STR.VAR[X,1] do stuff with VAR here . NEXT X Thanks in advance. Nick Cipollina Pick Programmer ACS - Heritage Information Systems, Inc. 2810 North Parham Road, Suite 210 Richmond, VA 23294 (804)644-8707 x 314 --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone +44 (0)20 7896 0011 and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Markets Limited and IG Index Plc are authorised and regulated by the Financial Services Authority and, in Australia, by the Australian Securities and Investments Commission. --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
I thought that UV10 had support for XML? I havn't used it, so I don't know how to go about it. Also, you could always try sending it off to PERL routine to parse, then give it back to UV. George PS. Nick, Are you from the Phila area? and is the ACS the same ACS from Malvern? >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] >Sent: Wednesday, September 15, 2004 10:48 AM >To: [EMAIL PROTECTED] >Subject: RE: [U2] [UV] Processing a string > > >I'm trying to parse some very long XML code. If I do it byte by byte >this way, it is taking a very long time to parse. We are >trying to find >a faster way to parse it. > >Thanks, > >Nick Cipollina > >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of >Adrian Matthews >Sent: Wednesday, September 15, 2004 8:59 AM >To: [EMAIL PROTECTED] >Subject: RE: [U2] [UV] Processing a string > >Depends what you're trying to achieve I suppose. If it's for a checksum >then there are commands to do that. If it's looking for occurrences of >text then there are commands to do that as well. > >If you have to step through a character at a time then that looks about >the best way of doing it to me. > >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of Nick Cipollina >Sent: 15 September 2004 13:32 >To: [EMAIL PROTECTED] >Subject: [U2] [UV] Processing a string > >What is the fastest way to process a long string byte by byte. I want >to know if there is a faster way to do the following: > > > >STR.VAR = "Some really really long string that has lots and lots of >characters for test processing." > >MAX.STR = LEN(STR.VAR) > >FOR X = 1 TO MAX.STR > >VAR = STR.VAR[X,1] > >do stuff with VAR here . > >NEXT X > > > >Thanks in advance. > > > >Nick Cipollina > > > >Pick Programmer > >ACS - Heritage Information Systems, Inc. > >2810 North Parham Road, Suite 210 > >Richmond, VA 23294 > >(804)644-8707 x 314 >--- >u2-users mailing list >[EMAIL PROTECTED] >To unsubscribe please visit http://listserver.u2ug.org/ > > >The information contained in this email is strictly >confidential and for >the use of the addressee only, unless otherwise indicated. If you are >not the intended recipient, please do not read, copy, use or >disclose to >others this message or any attachment. Please also notify the sender by >replying to this email or by telephone +44 (0)20 7896 0011 and then >delete the email and any copies of it. Opinions, conclusions >(etc.) that >do not relate to the official business of this company shall be >understood as neither given nor endorsed by it. IG Markets Limited and >IG Index Plc are authorised and regulated by the Financial Services >Authority and, in Australia, by the Australian Securities and >Investments Commission. >--- >u2-users mailing list >[EMAIL PROTECTED] >To unsubscribe please visit http://listserver.u2ug.org/ >--- >u2-users mailing list >[EMAIL PROTECTED] >To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
DING DING DING! You win the prize for guessing the implementation! Oh. No prize though. Only the satisfaction that you won. ;-) Glenn At 11:07 AM 9/15/2004, you wrote: Using VAR = STR.VAR[X,1] is probably the fastest. If my suspicions are correct, the C code to implement this function would simply use pointer math to pull the character from memory -- which is pretty darn fast. --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
Using VAR = STR.VAR[X,1] is probably the fastest. If my suspicions are correct, the C code to implement this function would simply use pointer math to pull the character from memory -- which is pretty darn fast. --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
I'm trying to parse some very long XML code. If I do it byte by byte this way, it is taking a very long time to parse. We are trying to find a faster way to parse it. Thanks, Nick Cipollina -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adrian Matthews Sent: Wednesday, September 15, 2004 8:59 AM To: [EMAIL PROTECTED] Subject: RE: [U2] [UV] Processing a string Depends what you're trying to achieve I suppose. If it's for a checksum then there are commands to do that. If it's looking for occurrences of text then there are commands to do that as well. If you have to step through a character at a time then that looks about the best way of doing it to me. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nick Cipollina Sent: 15 September 2004 13:32 To: [EMAIL PROTECTED] Subject: [U2] [UV] Processing a string What is the fastest way to process a long string byte by byte. I want to know if there is a faster way to do the following: STR.VAR = "Some really really long string that has lots and lots of characters for test processing." MAX.STR = LEN(STR.VAR) FOR X = 1 TO MAX.STR VAR = STR.VAR[X,1] do stuff with VAR here . NEXT X Thanks in advance. Nick Cipollina Pick Programmer ACS - Heritage Information Systems, Inc. 2810 North Parham Road, Suite 210 Richmond, VA 23294 (804)644-8707 x 314 --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone +44 (0)20 7896 0011 and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Markets Limited and IG Index Plc are authorised and regulated by the Financial Services Authority and, in Australia, by the Australian Securities and Investments Commission. --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
I've used that in the past for parsing strings that are several hundred thousand chars in length but there's no significant difference until then. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Glenn Herbert Sent: 15 September 2004 14:22 To: [EMAIL PROTECTED] Subject: Re: [U2] [UV] Processing a string You could fold the string into a dynamic array and use remove: STR.VAR= "Some really really long string that has lots and lots of characters for test processing." FOLDED.VAR=FOLD(STR.VAR,1); *creates dynarray of single characters LOOP REMOVE ACHAR FROM FOLDED.VAR SETTING MARK UNTIL NOT(MARK) and ACHAR="" DO * any character processing on ACHAR REPEAT I'm not sure of any actual performance gain compared with simply STR.VAR[x,1] but it's at least an alternate approach. At 08:31 AM 9/15/2004, you wrote: >What is the fastest way to process a long string byte by byte. I want >to know if there is a faster way to do the following: --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone +44 (0)20 7896 0011 and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Markets Limited and IG Index Plc are authorised and regulated by the Financial Services Authority and, in Australia, by the Australian Securities and Investments Commission. --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] [UV] Processing a string
You could fold the string into a dynamic array and use remove: STR.VAR= "Some really really long string that has lots and lots of characters for test processing." FOLDED.VAR=FOLD(STR.VAR,1); *creates dynarray of single characters LOOP REMOVE ACHAR FROM FOLDED.VAR SETTING MARK UNTIL NOT(MARK) and ACHAR="" DO * any character processing on ACHAR REPEAT I'm not sure of any actual performance gain compared with simply STR.VAR[x,1] but it's at least an alternate approach. At 08:31 AM 9/15/2004, you wrote: What is the fastest way to process a long string byte by byte. I want to know if there is a faster way to do the following: --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
Hi Nick, In this case the "do stuff with VAR here" is very important For example: If you want to change all VM to SVM in a long string then STR.VAR = CHANGE(STR.VAR,VM,SVM) will be faster It all depends on ...stuff... Louie -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nick Cipollina Sent: 15 September 2004 02:32 PM To: [EMAIL PROTECTED] Subject: [U2] [UV] Processing a string What is the fastest way to process a long string byte by byte. I want to know if there is a faster way to do the following: STR.VAR = "Some really really long string that has lots and lots of characters for test processing." MAX.STR = LEN(STR.VAR) FOR X = 1 TO MAX.STR VAR = STR.VAR[X,1] do stuff with VAR here . NEXT X Thanks in advance. Nick Cipollina Pick Programmer ACS - Heritage Information Systems, Inc. 2810 North Parham Road, Suite 210 Richmond, VA 23294 (804)644-8707 x 314 --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] [UV] Processing a string
Depends what you're trying to achieve I suppose. If it's for a checksum then there are commands to do that. If it's looking for occurrences of text then there are commands to do that as well. If you have to step through a character at a time then that looks about the best way of doing it to me. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nick Cipollina Sent: 15 September 2004 13:32 To: [EMAIL PROTECTED] Subject: [U2] [UV] Processing a string What is the fastest way to process a long string byte by byte. I want to know if there is a faster way to do the following: STR.VAR = "Some really really long string that has lots and lots of characters for test processing." MAX.STR = LEN(STR.VAR) FOR X = 1 TO MAX.STR VAR = STR.VAR[X,1] do stuff with VAR here . NEXT X Thanks in advance. Nick Cipollina Pick Programmer ACS - Heritage Information Systems, Inc. 2810 North Parham Road, Suite 210 Richmond, VA 23294 (804)644-8707 x 314 --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/ The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone +44 (0)20 7896 0011 and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Markets Limited and IG Index Plc are authorised and regulated by the Financial Services Authority and, in Australia, by the Australian Securities and Investments Commission. --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
[U2] [UV] Processing a string
What is the fastest way to process a long string byte by byte. I want to know if there is a faster way to do the following: STR.VAR = "Some really really long string that has lots and lots of characters for test processing." MAX.STR = LEN(STR.VAR) FOR X = 1 TO MAX.STR VAR = STR.VAR[X,1] do stuff with VAR here . NEXT X Thanks in advance. Nick Cipollina Pick Programmer ACS - Heritage Information Systems, Inc. 2810 North Parham Road, Suite 210 Richmond, VA 23294 (804)644-8707 x 314 --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/