Reading a text file and transfering data to a form

Cyber_Plague
Cyber_Plague used Ask the Experts™
on
Hi,

I have a problem here. I have a program which creates txt file and puts some data in it. The problem is - when i'm trying to read data from that file to the textbox in a form, it puts data in a quotation-marks: for example "John Brown" .
Does anybody know how to avaoid those quotation-marks? Meaning, I need that data to be written like this: John Brown, without quotation-marks.
I'll be glad to here every suggestion you have :)
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Well if a program is creating that text file whose source code you do not have then you can write your own program to remove the double quotes and format the text file.
If you have the source please put some code so that we can modify it.

Author

Commented:
command button code
name of command buttomn is command1
name of text boxes are text1, text2


********************************
Private Sub Command1_Click()
Dim nFile As Integer
nFile = FreeFile
Open "C:\myfile.txt" For Append Shared As #nFile
Write #nFile, CStr(Text1.Text) + " " + CStr(Text2.Text)
Close #nFile
End Sub
*********************************

Author

Commented:
well, it's not a very difficult program, but still i need to get rid of those quotation-marks
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
well, it's not a very difficult program, but still i need to get rid of those quotation-marks
Project manager
Commented:
Trim them away

txtLine = mid(txtLine,2,len(txtLine)-2)

Author

Commented:
Perfect solution! I'm a novice to VB, so this advice is very helpfull. I would like to make and amendemend to my question - how can i create an array from the data i'm writing to that file (for example : Name, Last name, Phone numb.)and organize search in that array?
I'll raise up points given to 100

Author

Commented:
Perfect solution! I'm a novice to VB, so this advice is very helpfull. I would like to make and amendemend to my question - how can i create an array from the data i'm writing to that file (for example : Name, Last name, Phone numb.)and organize search in that array?
I'll raise up points given to 100

Author

Commented:
Perfect solution! I'm a novice to VB, so this advice is very helpfull. I would like to make and amendemend to my question - how can i create an array from the data i'm writing to that file (for example : Name, Last name, Phone numb.)and organize search in that array?
I'll raise up points given to 100

Author

Commented:
Perfect solution! I'm a novice to VB, so this advice is very helpfull. I would like to make and amendemend to my question - how can i create an array from the data i'm writing to that file (for example : Name, Last name, Phone numb.)and organize search in that array?
I'll raise up points given to 100
Private Sub Command1_Click()
Dim nFile As Integer
nFile = FreeFile
Open "C:\myfile.txt" For Append Shared As #nFile
Print #nFile, CStr(Text1.Text) + " " + CStr(Text2.Text)  'Note the change in this line
Close #nFile
End Sub
Author of the Year 2009

Commented:
Hi Cyber_Plague,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept Dhaest's comment(s) as an answer.

Cyber_Plague, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept THIS comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial