473,786 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Importing a .txt file into an existing database

Hi everybody,

I am totally desperate because I cannot solve a really simple problem:
I have a specific text-file which I want to import into an existing
database. The problem is that the columns have different names so I
receive an error message when importing via the "Get External
Data"-Wizard.
The second problem is that this text file includes several rows
without any relevant data, only symbols like "-----" in the various
columns. I cannot change this data (and I cannot import it directly
via a SQL-statement) because it is extracted from a backend system and
I have no influence on those reports.

Here is an example of my import text file and the target database:
sample text file:
---- ---- ----
C1 C2 C3
---- ---- ----
1234 12A2 00B2
22B2 12A4 00C4

sample target database:
Columns:
Col1 Col2 Col3
1234 12A2 00B2
22B2 12A4 00C4

It really looks so easy, but I don't know how to do it.

THANKS in advance for your support!

Best wishes,
Stephan Kuhnert
Nov 13 '05 #1
2 3928
In message <88************ **************@ posting.google. com>, kuhni
<st************ @gmx.de> writes
Hi everybody,

I am totally desperate because I cannot solve a really simple problem:
I have a specific text-file which I want to import into an existing
database. The problem is that the columns have different names so I
receive an error message when importing via the "Get External
Data"-Wizard.
There are two ways you can get around this.

The first and simplest is to import the data into a new table then
create an append query to add the new table to your existing one. Then
delete the temporary table.

Another way is to use the wizard to import the data into a temporary
file but then save the import specifications and use them later,
specifying the destination table in a docmd transfertxt line.

From one of my databases:

DoCmd.TransferT ext , "Jobserve Import Specification", "Jobserve", fname,
False
The second problem is that this text file includes several rows
without any relevant data, only symbols like "-----" in the various
columns. I cannot change this data (and I cannot import it directly
via a SQL-statement) because it is extracted from a backend system and
I have no influence on those reports.


This may require pre-processing, possibly in a temporary table as
outlined above. Personally, I would pre-process the text file using a
tool such as awk or PERL before importing it.

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author. Will work for money.

Nov 13 '05 #2
st************@ gmx.de (kuhni) wrote in message news:<88******* *************** ****@posting.go ogle.com>...
Hi everybody,

I am totally desperate because I cannot solve a really simple problem:
I have a specific text-file which I want to import into an existing
database. The problem is that the columns have different names so I
receive an error message when importing via the "Get External
Data"-Wizard.
The second problem is that this text file includes several rows
without any relevant data, only symbols like "-----" in the various
columns. I cannot change this data (and I cannot import it directly
via a SQL-statement) because it is extracted from a backend system and
I have no influence on those reports.

Here is an example of my import text file and the target database:
sample text file:
---- ---- ----
C1 C2 C3
---- ---- ----
1234 12A2 00B2
22B2 12A4 00C4

sample target database:
Columns:
Col1 Col2 Col3
1234 12A2 00B2
22B2 12A4 00C4

It really looks so easy, but I don't know how to do it.

THANKS in advance for your support!

Best wishes,
Stephan Kuhnert


Take a look at

http://www.delphipages.com/result.cfm?ID=4743

with this utility you should be able to import datas in any database.

Tazio.
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2803
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...
1
3679
by: sparks | last post by:
I have never done this and wanted to ask people who have what is the best way. One person said import it to excel, then import it into access table. but since this will be done a lot, I am trying to avoid this extra step. can access read in this file directly into a table as append data? thank you very much for any pointers
3
2048
by: George Yeh | last post by:
Hi There! Currently I am importing a .csv file that eventually grows over time. I have setup my table with an unique id field that is the primary key and indexed. I have also indicated in the import specifiaction that this field is indexed and that no duplicates should be accepted. My problem right now is that each time I import this file into my database, it will overwrite what already exists and I would
5
3184
by: dixie | last post by:
If I sent a user an empty database container - dB with no tables and I needed them to import their tables into it and one of their tables was a hidden table with the prefix Usys, is there any way in code I can get that table imported without them having to go to options and show hidden tables and then import it manually? dixie
2
3185
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to set this up so as to do it reliably and minimize overhead? There are currently no constraints on the destination table. Assume the user or some configuration specifies the database name, server name, and filename+fullpath. The server is SQL...
17
2032
by: OdAwG | last post by:
Just some questions regarding tables. I am new Access Database and need a little help. I have the following data listed below 01. I have a table called tbl_Customer with the following information listed below 02. In that table I have three columns that have numeric data in it (City, State, Marital_Status) 03. I need to convert the numeric data in table tbl_customer (City, State, Marital_Status) to alpha numeric data 04. using the...
0
489
by: Alun Jones | last post by:
I'm getting the above error in a dialog box from Visual Studio 2005 when trying to sign an assembly using a PFX file, and would like to know how to resolve the problem. Background: The PFX file has been used for code-signing before (to sign an InfoPath form), so therefore the file contains a valid code-signing key. I have the correct password to the PFX file (because I get a different error
1
3112
by: puremetal33 | last post by:
I have worked very little with Access and have hit a snag. My task right now is to import the data from a spreadsheet into an existing table in an Access database. I edited the .xls file so that fields are laid out the same L-R and made certain that the data is the same in both the .xls file and the table it is to be imported to have the same data type in each field. I follow the File>Get External Data>Import path and choose the .xls...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9492
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
10163
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...
0
9960
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...
1
7510
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
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.