Welcome to dbFreaks.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

reading a text file?

 
   Database Help (Home) -> Visual Basic RSS
Related Topics:
how do u open a word file in VB?? - hi, i want to open a word file in my c drive. how do i do that in VB? i want to open it when i click a button. thanx devin

Cannot Delete Pocket Access File - I'm creating a Pocket Access file (via an EVB on a mobile device running PPC 2002. When the user logs off the EVB I want to delete the Access file (stored in the /Temp folder). However, I am unable to do this because the..

sql query returns in wrong format - Hi, Hope someone can help me with this. I have MS SQL 2000 database where i have Table and there a column wich is data type All data in this column is in form So why when i run .asp page with simple query to..

arrays - is there a way to the contents of an array (looping through the array) and storing each item in a comma delimited string? Thanks!

DataReport PageBreak - Hi everyone, I would like to know how to force pagebreak in a for example after 5 records printed. Thank you all
Next:  Visual Basic: how do u open a word file in VB??  
Author Message
WTG

External


Since: Feb 21, 2005
Posts: 1



(Msg. 1) Posted: Mon Feb 21, 2005 8:17 pm
Post subject: reading a text file?
Archived from groups: microsoft>public>vb>database (more info?)

Help! Sad

Is there a way to automate the importation of a text file in to VB,
with out having to use the import text wizard every time?

Below is a sample the the file and the inofrmation I need. ( the file
is actually much larger then this) but this will give you an idea. The
actual numbers will change from day to day,and so will the amount of
rows. But the file format and the number of columns will always be the
same. and the information I need will always be the same columns.

I've read books, tutorials and even information on dos batch files. Sad

I'm stuck, I have my whole spread sheet planned out. All my reports
and summarys but it's usuless without the ability to import this
information.

SOMEONE PLEASE HELP !!!


Thank you.

WTG.

SAMPLE:

Actual Text File:

000000000 07:5007:50 PON 0000<MN>22400130
000000000 08:1608:16 PON 0000<MN>22400140
000000000 11:2211:22 PON 0000<MN>22400120
000000000 11:4711:47 PON 0000<MN>22400115
000000000 06:1306:13 PON 0000<MN>22400155

Actual Information needed:

07:50 PON 22400130
08:16 PON 22400140
11:22 PON 22400120
11:47 PON 22400115
06:13 PON 22400155

 >> Stay informed about: reading a text file? 
Back to top
Login to vote
Michael Cole

External


Since: Feb 22, 2005
Posts: 4



(Msg. 2) Posted: Mon Feb 21, 2005 9:40 pm
Post subject: Re: reading a text file? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

WTG wrote:
 > Help! Sad
 >
 > Is there a way to automate the importation of a text file in to VB,
 > with out having to use the import text wizard every time?

VB or Access? VB (programming language, not database) doesn't (AFAIK) have
an "import text wizard". Access (which is the database, not the programming
language) does have an import wizard.



--
Regards,

Michael Cole<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: reading a text file? 
Back to top
Login to vote
user1891

External


Since: Dec 09, 2004
Posts: 8



(Msg. 3) Posted: Tue Feb 22, 2005 6:40 am
Post subject: Re: reading a text file? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Back to top
Login to vote
Dave195

External


Since: Oct 06, 2004
Posts: 2



(Msg. 4) Posted: Tue Feb 22, 2005 7:40 am
Post subject: Re: reading a text file? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

This is a pretty simple bit of programming if the columns are of fixed
width.

First read the whole file into a string, then using Split with CR/LF as the
delimiter seperate out each line to an array element, on each line use the
Mid function to extract each field.

If it is not fixed width you are going to have to find an alternative
demarkation between fields.

You will also need some way of selecting the file to import, the
CommonDialog is adequate for this, then you'll need to get the data into
your database, this is your choice; ADO, DAO, OBDC or whatever you know
about.

Dave.

"WTG" <wtg_designs.DeleteThis@hotmail.com> wrote in message
news:7fuk11tslc8dbbgerd7aapgrgmh3tbbvt7@4ax.com...
 > Help! Sad
 >
 > Is there a way to automate the importation of a text file in to VB,
 > with out having to use the import text wizard every time?
 >
 > Below is a sample the the file and the inofrmation I need. ( the file
 > is actually much larger then this) but this will give you an idea. The
 > actual numbers will change from day to day,and so will the amount of
 > rows. But the file format and the number of columns will always be the
 > same. and the information I need will always be the same columns.
 >
 > I've read books, tutorials and even information on dos batch files. Sad
 >
 > I'm stuck, I have my whole spread sheet planned out. All my reports
 > and summarys but it's usuless without the ability to import this
 > information.
 >
 > SOMEONE PLEASE HELP !!!
 >
 >
 > Thank you.
 >
 > WTG.
 >
 > SAMPLE:
 >
 > Actual Text File:
 >
 > 000000000 07:5007:50 PON 0000<MN>22400130
 > 000000000 08:1608:16 PON 0000<MN>22400140
 > 000000000 11:2211:22 PON 0000<MN>22400120
 > 000000000 11:4711:47 PON 0000<MN>22400115
 > 000000000 06:1306:13 PON 0000<MN>22400155
 >
 > Actual Information needed:
 >
 > 07:50 PON 22400130
 > 08:16 PON 22400140
 > 11:22 PON 22400120
 > 11:47 PON 22400115
 > 06:13 PON 22400155<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: reading a text file? 
Back to top
Login to vote
Display posts from previous:   
   Database Help (Home) -> Visual Basic All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]