Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String manipulation problem

Status
Not open for further replies.

BigM

Programmer
Aug 30, 2000
39
GB
Hi,

I have a text file in which fields are delimited by #~

I am wanting a method stripping the field values into variables for processing.

Any Ideas?

Thanks [sig][/sig]
 
I assume you are already using the FileSystemObject to get each line of text. We'll start from there...
Code:
<%
' strTextLine would be you FSO line
strTextLine = &quot;This is a test.#~This is also a test.#~This, as well, is a test.#~A test, is this.&quot;

Dim arrTemp
Dim maxCount
Dim i

arrTemp = Split(strTextLine,&quot;#~&quot;)

maxCount = UBound(arrTemp)

For i = 0 to maxCount
 Response.Write &quot;Index &quot; & i & &quot;: &quot; & arrTemp(i) & &quot;<br>&quot;
 ' here instead you could pass each individual array value into the proper variable
Next
%>

Hope it helps, [sig]<p>Rob<br><a href=mailto:robschultz@yahoo.com>robschultz@yahoo.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
"Focus on the solution to the problem,<br>
not the obstacles in the way."<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top