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

Manipulating Textfile Thru VB 6 ?

Status
Not open for further replies.

moulee

Programmer
Jan 12, 2003
9
IN
hi experts,

i developing an flash prj
which reads the content the textfile.

but there we can't to write into textfile directly

for that part i need the VB usage.

which contains Add,Delete,Modify button
when we click the button the operation should to be done

i briefy giveout the concept:

assume that there is an object flower
its related website r stored in the notepad
as "flower.txt"

with out opening the file explicitly i have to change the content in the text file thru the visual basic.

there in notepad the websites as in the below format:

&FLOWER Website:
================
&flower1=&flower2=&flower3=
&flower4=
&flower5=
&flower6=
&flower7=
..
upto 15

now i want to add the new website which stored on the next empty variable
then i also
able to delete the website,
able to modify the content in the existing website.

how can be possible thru vb
please give me the sample that will help a lot!!!

with Regards,
moulee
 
Look into the Open and Input commands in the help files. You will want something similar to,

Open ,filename. For Input As #1
Print #1, <whatever>
Close #1
Thanks and Good Luck!

zemp
 
You can look into using the split function to place the text file into an array. Then you can assign the array elements to variables.

Place the file into a variable.

Line Input #1, strData

Split the variable into a dynamic array.

strArray = Split(strData, vbCrLf)

In this case the data is split using the vbCrLf character. You can use any deliniating character that you need to.

Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top