Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I've come across another delima. I have written to a textfile, but I need a "separator" so that my data can be read into my text boxes. Can somebody please help me?! I am lost:(

 

Thanks! Mindi

Posted

the format is simply a text file. .txt

 

thisistochecktoseeifthiscreatesanewfile

 

I want each word(I typed each word into a separate text box, write to a file) and now I want each word to show up on a form, each in it's own text box.

  • *Experts*
Posted

Oh, ok. Then when you write the text file, add some delimeter (a

comma, or something; make sure it doesn't appear in any of the words

you want to retrieve from the file). So your file might looks like this:

 

The,quick,brown,fox,jumps,over,the,lazy,dog

 

When you read the textfile, read it all in at once, and use the Split

function of the string you read it into, like

Dim words() As String
Dim fileIn As String

'Read your file into the fileIn variable here

words = fileIn.Split(",")

And now you will be left with words(), an array of strings containing

all of the words from your text file. Loop through them and do whatever

you wish with them (adding them to textboxes, I guess).

Posted
Uh, I am a beginner (as if you couldn't tell!) but could you maybe help me with the code for read your file into the filein variable portion? Sorry I know this is probably super menial to you. But I really appreciate your help!!! THanks! Mindi

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...