473,734 Members | 2,274 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

one text file in to two different table

92 New Member
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 1327
JConsulting
603 Recognized Expert Contributor
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
voroojak
92 New Member
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 Recognized Expert Contributor
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
3793
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 displays these fileds and values in different ways so am creating one page and parsing variables to it. The problem appears to be in trying to write the values to a text file. The page displays the field names correctly but when I submit the form...
18
2541
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 standard part of the module, here's my vote: +1 -- Wade Leftwich Ithaca, NY
7
3384
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 in the wrong direction. I want to count several strings of text in a file (security.txt) and output the counts with a brief description of each. I have tried specifying the descriptions (name) and the strings (exe) in the array within the perl...
7
6218
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 make it better soon. Unfortunately, there is never a non-crucial time in which we can do an upgrade, so we are stuck for now. Point 1: There are multiple tables: students, courses, cross-reference
4
12725
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 though the file may be too big! When I try to do it via command line: mysql -u root --host=localhost printing < ./printing.txt It eventually errors out with a "syntax error on line X" and only about
1
2799
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 different, but somewhat logical naming structures (ex.Jun01.txt, Jun02.txt, Jul01.txt, etc...). Is there a relatively simple way to accomplish this, considering i'm new to Access. I was especially hoping to do this without having to manually...
4
2072
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 prints and mails our bills. The application basically creates a table then exports a comma delimited file of that table. The problem is that we keep getting one seemingly random record in the text file that is misaligned. The record in question is...
10
3520
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 Response Headers - http://www.hixie.ch/advocacy/xhtml Date: Wed, 23 Nov 2005 21:36:06 GMT Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e Vary: Accept-Encoding,User-agent
9
3135
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 be inserted into a standard web address in the table (the filed name is link) in ddw1 Example address ---
2
1819
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 and paste the dissimilar records manually into the text file, so it would seem that should be possible to do programatically. I set up export specifications for each of the twelve tables and tried to export each to the same text file. This...
0
8780
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9315
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9246
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9186
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8190
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6742
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4816
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3264
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.