473,378 Members | 1,420 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,378 software developers and data experts.

Import from .txt to Access 2003

Hello,
I am trying to import a fixed width text file with possible different widths based on a value in one field. I have the data .txt file and a spec file which describes the fixed width of one group of characters based on a value in a different field. I have pasted an example below. I thought a script would best handle this but cannot find any data describing how. Also, there are character sat the end of the rows that are "unpacked" and i cannot seem to find anything that will unpack these for me.

Text file
FL01 999STSFLD DTSE200712030702IGP9MAYER JERA* J  ÄÈ
FL01 999STSFLD DTSE200712030704IEP9WOODRUFF TIM* A T  À-<
FL01 999STSFLD DTSE200712031157IEP1 M 56 34 34  ã*

Spec file
02 SEARCH-DETAIL-ACTIVITY-REC.
05 PSDAC-PLANT-SEARCH-PARAM.
10 PSDAC-STATE-COUNTY.
20 PSDAC-STATE-CODE PIC X(2).
20 PSDAC-COUNTY-CODE PIC X(2).
10 PSDAC-ACCOUNT-NUMBER PIC X(10).
10 PSDAC-TITLE-COMPANY-CODE PIC X(3).
10 PSDAC-BRANCH-ID PIC X(3).
10 PSDAC-ORDER-NUMBER PIC X(15).
10 PSDAC-USER-ID PIC X(4).
10 PSDAC-SEARCH-DATE.
20 PSDAC-SEARCH-DATE-CC PIC 9(02).
20 PSDAC-SEARCH-DATE-YY PIC 9(02).
20 PSDAC-SEARCH-DATE-MM PIC 9(02).
20 PSDAC-SEARCH-DATE-DD PIC 9(02).
10 PSDAC-SEARCH-REQUEST-TIME.
20 PSDAC-SEARCH-REQUEST-HOUR PIC 9(2).
20 PSDAC-SEARCH-REQUEST-MINUTE PIC 9(2).
10 PSDAC-TYPE-OF-SEARCH PIC X.
88 PSDAC-ORDER-SEARCH VALUE 'O'.
88 PSDAC-DATEDOWN VALUE 'D'.
88 PSDAC-INVESTIG-SEARCH VALUE 'I'.
10 PSDAC-ENTERED-GENERATED-IND PIC X.
88 PSDAC-PARM-WAS-ENTERED VALUE 'E'.
88 PSDAC-PARM-WAS-GENERATED VALUE 'G'.
10 PSDAC-APPLICATION-TYPE PIC X.
88 PSDAC-PLANT-PARM VALUE 'P'.
88 PSDAC-TAX-PARM VALUE 'T'.
10 PSDAC-SEARCH-PARAMETER.
20 PSDAC-PARAMETER-TYPE PIC X.
88 PSDAC-SUBDIVIDED-PARM VALUE '1'.
88 PSDAC-SECTIONAL-PARM VALUE '2'.
88 PSDAC-ARB-APN-PARM VALUE '3'.
88 PSDAC-MINING-CLAIM-PARM VALUE '4'.
88 PSDAC-RANCHO-PARM VALUE '5'.
88 PSDAC-ABSTRACT-PARM VALUE '6'.
88 PSDAC-INSTRUMENT-PARM VALUE 'I'.
88 PSDAC-INST-ALIAS-PARM VALUE 'J'.
88 PSDAC-INST-BOTH-PARM VALUE 'K'.
88 PSDAC-REFERENCE-INST-PARM VALUE '7'.
88 PSDAC-REFERENCE-ALIAS-PARM VALUE '8'.
88 PSDAC-NAME-PARM VALUE '9'.
88 PSDAC-REFERENCE-BOTH-PARM VALUE 'A'.
88 PSDAC-CASE-PARM VALUE 'C'.
20 PSDAC-PARAMETER-DETAIL PIC X(100).
20 PSDAC-SUB-DETAIL
REDEFINES PSDAC-PARAMETER-DETAIL.
30 PSDAC-SUB-PLAT PIC X(12).
30 PSDAC-SUB-BLOCK PIC X(6).
30 PSDAC-SUB-LOT-N-SUBLOTS.
35 PSDAC-SUB-LOT PIC X(8).
35 PSDAC-SUB-HI-LOT PIC X(8).
35 PSDAC-SUB-SUB-LOT PIC X(6).
35 PSDAC-SUB-HI-SUB-LOT PIC X(6).
30 PSDAC-SUB-SPACES PIC X(54).
20 PSDAC-SECTIONAL-DETAIL
REDEFINES PSDAC-PARAMETER-DETAIL.
30 PSDAC-SEC-TWP-DIR PIC X.
30 PSDAC-SEC-RNG-DIR PIC X.
30 PSDAC-SEC-TWP.
35 PSDAC-SEC-TWP-NBR PIC X(3).
35 PSDAC-SEC-TWP-HALF PIC X.
30 PSDAC-SEC-RNG.
35 PSDAC-SEC-RNG-NBR PIC X(3).
35 PSDAC-SEC-RNG-HALF PIC X.
30 PSDAC-SEC-SECTION PIC X(3).
30 PSDAC-SEC-QUARTER PIC X(6).
30 PSDAC-JUNK1 REDEFINES PSDAC-SEC-QUARTER.
35 PSDAC-SEC-GOVT-LOT-IND PIC X(3).
35 PSDAC-SEC-GOVT-LOT PIC X(3).
30 PSDAC-SEC-ARB PIC X(9).
30 PSDAC-SEC-SPACES PIC X(72).
20 PSDAC-ARB-DETAIL
REDEFINES PSDAC-PARAMETER-DETAIL.
30 PSDAC-ARB PIC X(50).
30 PSDAC-HI-ARB PIC X(50).
20 PSDAC-MINING-CLAIM-DETAIL
REDEFINES PSDAC-PARAMETER-DETAIL.
30 PSDAC-CLAIM-NAME PIC X(25).
30 PSDAC-DISTRICT PIC X(18).
30 PSDAC-MINE-SPACES PIC X(57).
20 PSDAC-ABSTRACT-DETAIL
REDEFINES PSDAC-PARAMETER-DETAIL.
30 PSDAC-ABSTRACT-ID PIC X(05).
30 PSDAC-LOW-ACRES PIC S9999V99999 COMP-3.
30 PSDAC-HIGH-ACRES PIC S9999V99999 COMP-3.
30 PSDAC-ABSTRACT-SPACES PIC X(85).
20 PSDAC-REF-INST-DETAIL
REDEFINES PSDAC-PARAMETER-DETAIL.
30 PSDAC-REF-ORIG-INST PIC X(13).
30 PSDAC-REF-SPACES PIC X(87).
20 PSDAC-INSTRUMENT-DETAIL
REDEFINES PSDAC-PARAMETER-DETAIL.
30 PSDAC-INSTRUMENT-NUM PIC X(13).
30 PSDAC-INST-SPACES PIC X(87).
20 PSDAC-CASE-DETAIL
REDEFINES PSDAC-PARAMETER-DETAIL.
30 PSDAC-CASE-NUM PIC X(18).
30 PSDAC-CASE-SPACES PIC X(82).
20 PSDAC-NAME-DETAIL
REDEFINES PSDAC-PARAMETER-DETAIL.
30 PSDAC-NAME-LAST PIC X(25).
30 PSDAC-NAME-FIRST PIC X(12).
30 PSDAC-NAME-MI PIC X(1).
30 PSDAC-NAME-SPOUSE.
35 PSDAC-NAME-SPOUSE-FIRST PIC X(12).
35 PSDAC-NAME-SPOUSE-MI PIC X(1).
30 PSDAC-NAME-SPACES PIC X(49).
20 PSDAC-PARTY-ROLE.
30 PSDAC-PARTY.
35 PSDAC-PARTY-LAST PIC X(25).
35 PSDAC-PARTY-FIRST PIC X(12).
35 PSDAC-PARTY-MI PIC X.
30 PSDAC-ROLE PIC X(6).
20 PSDAC-SOC-SEC-NBRS REDEFINES
PSDAC-PARTY-ROLE.
30 PSDAC-NAME-SOC-SEC-NBR PIC X(9).
30 PSDAC-NAME-SPOUSE-SSN PIC X(9).
30 PSDAC-SOC-SEC-SPACES PIC X(26).
10 PSDAC-NAME-SEARCH-IND PIC X.
88 PSDAC-GI-NAME-SEARCH VALUE 'G'.
88 PSDAC-TORTEE-NAME-SEARCH VALUE 'T'.
10 PSDAC-PARAMETER-COUNT PIC S9(9) COMP-3.
10 PSDAC-EIBTASKN PIC S9(7) COMP-3.
10 FILLER PIC X(46).
Jan 24 '08 #1
1 1868
nico5038
3,080 Expert 2GB
This will be a daunting effort :-)

For some background info you can check:
http://www.3480-3590-data-conversion...le-import.html

Personally I woldn't try to create a script for this. The Redefines and the Computational fields aren't really easy to interpret.
Best to use a COBOL application to print these records and process the result :-)

Nic;o)
Jan 28 '08 #2

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

Similar topics

3
by: Jon Ole Hedne | last post by:
My Access 2002-application need to work with tables from both Oracle and Access. To solve this, I want to run some querys on three views in Oracle and import the results into temporary...
1
by: mark | last post by:
In Access 2000 and 2002, I have created an import specification to import the fixed-width recordset below into an existing table. I am having strange problems with the import of the date and time...
2
by: Dave | last post by:
We just shifted to Access 2003 at work. I have a database that contains information that is updated each month with another (source) Access file. To update the fields in our database, I built...
1
by: Dan | last post by:
Could someone please help me with auto importing a series of data files into an Access table. I tried to follow code given below in a previous messagebut i'm getting error messages. Here's my...
1
by: Haidee | last post by:
Hi I'm pretty new to MS Access so please be patient.... I have a user that is trying to import an external excel spreadsheet into MS access 2003 by using the File - Get external data - Import. ...
1
by: rrrelic | last post by:
Can someone help me with this? I am running Access 2003 and attempting to import and append multiple XML files into Access. I currently do this process using the Import tool built into Access’s...
3
by: MarcGA | last post by:
(Excel 2003, Access 2003, XP, novice user here) I can't get Access to accept multiple Excel files to the same table. I can import the spreadsheets to a new table, but I need to import 23...
9
by: a | last post by:
Dear friends I want import data from CSV file to mdb file How can I do that in vb.net?
1
by: jollyroger | last post by:
I have searched the web forums, and can't seem to find an answer to this particular problem I have. In an excel sheet, cells in one column have formatted text in the "wrapped" cells. For many of...
2
DAF LAD
by: DAF LAD | last post by:
Hi. I have been running an access Database in Office 2003 for a while now. When I upgraded to Office 2007 one of my macro buttons has stopped working. The Button looks up to VBA code to Import...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.