p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_howto thread: Parsing


Message #1 by 9724613@s... on Fri, 30 Mar 2001 17:31:12
If the numbers always come in that format, I suppose you could do a few
things.

First, you could strip out the ','. Then you could make a loop that would
change 2 spaces "  " to 1 space " ", and repeat until you don't have any
more occurances of 2 spaces, then split the string by the single space into
an array, then  you can just reference the numbers as you need to using the
resulting array.

<code>
'strOneLine = <-- put a line from the file here
strOneLine = Replace(strOneLine, ",", "")
Do
	strOneLine = Replace(strOneLine, "  ", " ")
Loop While InStr(strOneLine, "  ") > 0
astrArray = Split(strOneLine, " ")
</code>

Peter

-----Original Message-----
From: 9724613@s... [mailto:9724613@s...]
Sent: Friday, March 30, 2001 12:31 PM
To: How To
Subject: Parsing


Hi I'm parsing a text file using the Mid, inStr,left and right functions.
I'm taking out numbers from a row as below:
12, 14, 22, 28, 29, 42         19
I've parsed out the first 5 numbers telling it to take the information as
far as the comma. How do I get the 6th and 7th numbers, where do I tell it
to stop.

Ps the numbers change ever week so when retrieving the 6th number i can't
tell it to stop when it gets to "1"

If anyone can help with this I would grreatly appreciate it

Thanks a million
Christine.
---
SoftArtisans helps developers build robust, scalable Web applications!
Excel Web reports, charts: http://www.softartisans.com/excelwriter.html
File uploads: http://www.softartisans.com/saf.html
Transactional file management: http://www.softartisans.com/saf1.html
Scalability: http://www.softartisans.com/saxsession.html
ASPstudio value pack: http://www.softartisans.com/aspstudiosuite.html


  Return to Index