473,387 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

one text file in to two different table

I have a bog problem in access
what i have to do is that
i have a text file that i have to insert it into access. but the problem is that there is two differnt type of data in my text file.
the one that have rpt:1 have differnt format of those who hast rpt:2. but they are all in one text file.
what i want to di is that i want to say that when ever rpt is equal 1 put in this table and whenever the rpt is 2 put in the other table.

i have to be able to read the text file and then send it into another table

i would appreciate any help.
thanks
Sep 14 '07 #1
3 1312
JConsulting
603 Expert 512MB
I have a bog problem in access
what i have to do is that
i have a text file that i have to insert it into access. but the problem is that there is two differnt type of data in my text file.
the one that have rpt:1 have differnt format of those who hast rpt:2. but they are all in one text file.
what i want to di is that i want to say that when ever rpt is equal 1 put in this table and whenever the rpt is 2 put in the other table.

i have to be able to read the text file and then send it into another table

i would appreciate any help.
thanks
can you post a small sample of the data...and how it looks in the file?

something like this may help out

Expand|Select|Wrap|Line Numbers
  1. Function importtxtfile(strFile As String) As Long
  2. Dim MyString As String
  3. Open strFile For Input As #1
  4. Do While Not EOF(1)
  5.     Line Input #1, MyString
  6.     'Here you can either parse your fields based on the delimiter
  7.     'or you can use the instr(mystring, "xxx") to identify what table
  8.     'then
  9.     'use an insert statement to put the line into the proper table
  10. Loop
  11. Close #1    ' Close file.
  12. End Function
  13.  
J
Sep 14 '07 #2
i havent done that much
i just create two tables with the fields.
if the report tybe be 1 then have different field with rport type 2.
also i dont wantt o enter all the fields that is in text field.
and also in my text field in one line there is two field in other line there is 3 field.
i may just need one field in one line and i also want to escape some lines.
if i want to explain i have to same that cosider that theree is comment card that the customer has fill it.
what i need is to get those fields that i need and then again go the next entry. this is a very big text file

thanks alot
Sep 14 '07 #3
JConsulting
603 Expert 512MB
i havent done that much
i just create two tables with the fields.
if the report tybe be 1 then have different field with rport type 2.
also i dont wantt o enter all the fields that is in text field.
and also in my text field in one line there is two field in other line there is 3 field.
i may just need one field in one line and i also want to escape some lines.
if i want to explain i have to same that cosider that theree is comment card that the customer has fill it.
what i need is to get those fields that i need and then again go the next entry. this is a very big text file

thanks alot
There has to be rules when it comes to automating the import of data. Without those , I do not know how to help you. I understand that you don't need ALL data...but to exclude some, or choose some based on some logic...YOU have to define that that is. I'll monitor this question if you can come back with some definition of that that is.
J
Sep 15 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Paul C-T | last post by:
Hi, Am I trying to be too clever here? I am trying to write a PHP page to enable me to enter values into a form then write those values to a text file. I want to use the form & table that...
18
by: Wade Leftwich | last post by:
Every couple of months I have a use for the experimental 'scanner' object in the re module, and when I do, as I did this morning, it's really handy. So if anyone is counting votes for making it a...
7
by: Sam Lowry | last post by:
Greetings. I am trying to do something which should elementary for Perl, but I have only been able to find bits and pieces on it. When I put the bits together they do not work. Maybe I am going...
7
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to...
4
by: news | last post by:
Our production database in an exported textfil runs about 60 MB. Compressed that's about 9 MB. I'm trying to import the export into another machine running FC3 and mySQL 11.18, and it appears as...
1
by: D Mat | last post by:
Hi, I'm trying to get MS Access 2000 to automatically import a series of (~200) flat text, tab delimited, data files into a single Access table, with consistent fields and rows. The files have...
4
by: Jay | last post by:
This is a strange one that I can't seem to find a fix for. We have a Billing DB application (Access 2000 format) where we upload billing info in a comma delimited text file to our printer who...
10
by: Eric Lindsay | last post by:
This may be too far off topic, however I was looking at this page http://www.hixie.ch/advocacy/xhtml about XHTML problems by Ian Hickson. It is served as text/plain, according to Firefox...
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
2
by: Steve Cartnal | last post by:
I need to copy records from several different tables into one text file. Although the tables have many common fields, they also contain several that are different from table to table. I can copy...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
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...
0
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...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.