Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hello

 

I just wanna ask how can i do this.

 

The problem is i have a database that looks like this

 

#232323

xxxxx xxxxx xxxxx xxxxx

xxxxx xxxxxxx xxxxxxxxxxxxxxxx

xxxxxxxx xxxx

 

#233224

 

I need to get the xxxxxx into a field in a database. If there is a nice way already present on the board please point me to it, cos im new to VB.net.

 

There are around 3000 such sets in a txt file.

  • *Experts*
Posted

Do you mean you have a text file that looks like:

#232323
xxxxx xxxxx xxxxx xxxxx
xxxxx xxxxxxx xxxxxxxxxxxxxxxx
xxxxxxxx xxxx
#233224

 

And you need to parse the numbers into individual fields and save them to the database?

 

-nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
  • *Experts*
Posted

How much programming do you know? Do you know how to connect to the DB and save records? Do you know how to read text files? Do you know how to read in strings and possibly use regular expressions (or just Substring method calls)?

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted
i know how to connect to a database and thats about it. I do know a little about the rest but not enough to write the programm myself.
  • *Experts*
Posted

Well, we don't write programs for people here. We expect you to try and write the program. As you go along and run into specific problems, we love to help out!

 

I would start by writing a few test apps. Try updating a database table (assuming you already have a table created). Make sure all that code works.

 

Next try reading from the text file. Look at the various classes in System.IO - there are plenty to choose from. Getting to know them so you know which is best is half the fun of programming.

 

Finally, you'll need to parse what you read. You could use simple substring and fixed offsets, or various methods to split the string based on a space, or maybe use Regular Expressions. If you want to try regular expressions, search these forums and the help files for examples.

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

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...