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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read/Write to a specific field...

Status
Not open for further replies.

Tactical

Technical User
Joined
Aug 24, 2003
Messages
36
Location
CA
I'm trying to get my head around writing to a specific field. My text file contains 3 rows of info. The first row contains three fields comma delimited while to second and third rows only contain one field per say. Example:

"Prefix","Incremental #","ignore this field"
"ignore this line"
"ignore this Line"

I've read some info on writing whole lines, etc. using the split function to read fields but how does one write back to a specific field.

The end result that I'm hoping for is to assign to a var the "Prefix" & "Incremental #" after I've incremented by 1 and also write the new incremental value back to the correct field.

Any guidance appreciated.

Iris
 
A starting point:
a = Split(strLine, ",")
a(1) = a(1) + 1
strLine = Join(a, ",")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top