Could anyone spare some time and try to help me out.
I've got a .txt data file with a name, pin, balance seperated by commas. I
am opening the file and using Split to split it between the ,'s I need to
read it into an array and then check if what was entered as a name by the
user is in the array.
Can anyone be of help? Please Skype me, using the Text chat of skype. I
can transfer code just using text.....I have the code written but I dont
think I am doing something right because whenever I enter a name it is
coming back as invalid. At this point I am not even sure if I have the
array built.
Skype name: vbnethelp
Or if someone could show me how to make an array reading from a file that is
seperated by commas as above and would contain 10 records.
thank you. 4 1489
Jason
Are you using VS 2005? If so, this is available as one of the code snippets
(under File System).
Dim filename As String = "C:\Test.txt"
Dim fields As String()
Dim delimiter As String = ","
Using parser As New TextFieldParser(filename)
parser.SetDelimiters(delimiter)
While Not parser.EndOfData
' Read in the fields for the current line
fields = parser.ReadFields()
' Add code here to use data in fields variable.
'e.g. fields(0) would be your Name field
End While
End Using
HTH
Richard
"Jason" wrote: Could anyone spare some time and try to help me out.
I've got a .txt data file with a name, pin, balance seperated by commas. I am opening the file and using Split to split it between the ,'s I need to read it into an array and then check if what was entered as a name by the user is in the array.
Can anyone be of help? Please Skype me, using the Text chat of skype. I can transfer code just using text.....I have the code written but I dont think I am doing something right because whenever I enter a name it is coming back as invalid. At this point I am not even sure if I have the array built.
Skype name: vbnethelp
Or if someone could show me how to make an array reading from a file that is seperated by commas as above and would contain 10 records.
thank you.
VS.Net 2003 that is what I have here.
"Richard Bysouth" <sl***@nospam.nospam> wrote in message
news:4C**********************************@microsof t.com... Jason
Are you using VS 2005? If so, this is available as one of the code snippets (under File System).
Dim filename As String = "C:\Test.txt" Dim fields As String() Dim delimiter As String = ","
Using parser As New TextFieldParser(filename) parser.SetDelimiters(delimiter)
While Not parser.EndOfData ' Read in the fields for the current line fields = parser.ReadFields()
' Add code here to use data in fields variable. 'e.g. fields(0) would be your Name field
End While End Using
HTH
Richard
"Jason" wrote:
Could anyone spare some time and try to help me out.
I've got a .txt data file with a name, pin, balance seperated by commas. I am opening the file and using Split to split it between the ,'s I need to read it into an array and then check if what was entered as a name by the user is in the array.
Can anyone be of help? Please Skype me, using the Text chat of skype. I can transfer code just using text.....I have the code written but I dont think I am doing something right because whenever I enter a name it is coming back as invalid. At this point I am not even sure if I have the array built.
Skype name: vbnethelp
Or if someone could show me how to make an array reading from a file that is seperated by commas as above and would contain 10 records.
thank you.
Hi Jason,
Please post your code here, so someone can review it and let you know what
minor error exists.
Regards,
Cerebrus.
"Jason" <no**@none.invalid> wrote in message
news:uP**************@TK2MSFTNGP12.phx.gbl... VS.Net 2003 that is what I have here.
"Richard Bysouth" <sl***@nospam.nospam> wrote in message news:4C**********************************@microsof t.com... Jason
Are you using VS 2005? If so, this is available as one of the code snippets (under File System).
Dim filename As String = "C:\Test.txt" Dim fields As String() Dim delimiter As String = ","
Using parser As New TextFieldParser(filename) parser.SetDelimiters(delimiter)
While Not parser.EndOfData ' Read in the fields for the current line fields = parser.ReadFields()
' Add code here to use data in fields variable. 'e.g. fields(0) would be your Name field
End While End Using
HTH
Richard
"Jason" wrote:
Could anyone spare some time and try to help me out.
I've got a .txt data file with a name, pin, balance seperated by
commas. I am opening the file and using Split to split it between the ,'s I need to read it into an array and then check if what was entered as a name by
the user is in the array.
Can anyone be of help? Please Skype me, using the Text chat of skype. I can transfer code just using text.....I have the code written but I
dont think I am doing something right because whenever I enter a name it is coming back as invalid. At this point I am not even sure if I have the array built.
Skype name: vbnethelp
Or if someone could show me how to make an array reading from a file
that is seperated by commas as above and would contain 10 records.
thank you.
Jason,
You can use for this OleDB and read than with some instructions the complete
file in a dataset.
Have a look at this sample on our website. http://www.vb-tips.com/default.aspx?...f-212f9e0de193
I hope this helps,
Cor
"Jason" <no**@none.invalid> schreef in bericht
news:%2****************@tk2msftngp13.phx.gbl... Could anyone spare some time and try to help me out.
I've got a .txt data file with a name, pin, balance seperated by commas. I am opening the file and using Split to split it between the ,'s I need to read it into an array and then check if what was entered as a name by the user is in the array.
Can anyone be of help? Please Skype me, using the Text chat of skype. I can transfer code just using text.....I have the code written but I dont think I am doing something right because whenever I enter a name it is coming back as invalid. At this point I am not even sure if I have the array built.
Skype name: vbnethelp
Or if someone could show me how to make an array reading from a file that is seperated by commas as above and would contain 10 records.
thank you. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Row |
last post by:
HI,
I would first like to say its been about 3 years since looking at java
im very rusty!
I have to write a post it notes type applet which will function
online. (reading from a flat text file)...
|
by: Markus Hofmann |
last post by:
Hi @ all
hope someone can help me as my PC is ready to go through the
window...here it is:
I have a text file with approximately 150,000 lines of the following
format:
...
|
by: Foxy Kav |
last post by:
Hi, another question from me again, i was just wondering if anyone
could give me a quick example of reading data from a file then placing
the data into an array for some manipulation then reading...
|
by: Sabin Finateanu |
last post by:
Hi I'm having problem reading a file from my program and I think it's from a
procedure I'm using but I don't see where I'm going wrong. Here is the code:
public bool AllowUsage()
{
...
|
by: mitek777 |
last post by:
Hi, I have a problem with reading from file. I would like to find some
string(f e.g. name) in file, and if it exist show it on screen with
second and third line under.
I have this in file:
...
|
by: steven acer |
last post by:
hello,
i have a java app that constructs an xml from a specific file format
and vice versa.
i've been asked to convert it to c++, but im not an expert in c++,
actually im mere beginner you can...
|
by: Paul David Buchan |
last post by:
Hello,
I'm attempting to write a program to read in database files (.dbf).
When I do it all as a single procedure in main, everything works.
However, what I really want, is to pass the database...
|
by: Dudely |
last post by:
I've got a weird problem. I'm trying to pull the phone number off a
webpage (you can see it below if you search for "context"), but
somehow SKYPE has usurped the HTML DOM in a way I don't...
|
by: blunt |
last post by:
trying to write a program to write the configuration files for a load of wireless access points. i've never been a good programmer and haven't done any for nearly a decade so have obviously made some...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
| |