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

List box and txt data

Status
Not open for further replies.

OzzieBloke

Programmer
Mar 28, 2004
31
AU
Hi, I have a list box, called List1. This list box is filled with information gathered from a file, called source.txt.

My problem is that i want to edit a piece of data without messing up the order. My solution would be to copy all of the data above the selected item to one file, copy all of the data to another file, and then copy the data that is to be edited to yet another file. Then once all editing is done merge the three files back together.

I know how to copy all data from one file to another, and merge the three files. However I don't know how to copy data up to a certain point.
 
Why not read the whole datafile into a string variable in VB. You know the string item from the listbox you want to replace, so then use the replace function to change the single value. The put the text backl into the original file.

No need to regroup three files into 1, just use variables.

BB
 
Because I don't know how to use string variables, and I can't find any information on it.
 
You want to use the filesystemobject.

Search this forum for replace, fso, fileSystemObject, string concatenation.

There are planty of good examples here to use.

BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top