473,387 Members | 1,757 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.

Create one record with a file with some records related to the same record

Hi, I have this file that some lines are related to the same record. I need to analize it but I need to create a flat file. I want to every time that the record start with an ENT split it and add to the right the records below the ENT.

ENT*3*2J*34*555555555~
NM1*QE*1*FIGUEROA~
RMR*11*DB020920002010080013644378028**0~
DTM*582****RD8*20060801-20060831~
RMR*IK*47A0612**0*0~
ADX*.00*IA~
ENT*4*2J*34*999999999~
NM1*QE*1*FIGUEROA~
RMR*11*DB020920002010080013644378028**0~
DTM*582****RD8*20060901-20060930~
RMR*IK*47A0612**0*0~
ADX*.00*IA~

Iwant the file like this:
ENT*3*2J*34*555555555~NM1*QE*1*FIGUEROA~RMR*11*DB0 20920002010080013644378028**0~DTM*582****RD8*20060 801-20060831~RMR*IK*47A0612**0*0~ADX*.00*IA~
ENT*4*2J*34*999999999~NM1*QE*1*FIGUEROA~RMR*11*DB0 20920002010080013644378028**0~DTM*582****RD8*20060 901-20060930~RMR*IK*47A0612**0*0~ADX*.00*IA~

Well, all the data in one record.

I apreciate if someone can help me. I only know how to use access.
Jan 26 '08 #1
1 2313
Jim Doherty
897 Expert 512MB
Hi, I have this file that some lines are related to the same record. I need to analize it but I need to create a flat file. I want to every time that the record start with an ENT split it and add to the right the records below the ENT.

ENT*3*2J*34*555555555~
NM1*QE*1*FIGUEROA~
RMR*11*DB020920002010080013644378028**0~
DTM*582****RD8*20060801-20060831~
RMR*IK*47A0612**0*0~
ADX*.00*IA~
ENT*4*2J*34*999999999~
NM1*QE*1*FIGUEROA~
RMR*11*DB020920002010080013644378028**0~
DTM*582****RD8*20060901-20060930~
RMR*IK*47A0612**0*0~
ADX*.00*IA~

Iwant the file like this:
ENT*3*2J*34*555555555~NM1*QE*1*FIGUEROA~RMR*11*DB0 20920002010080013644378028**0~DTM*582****RD8*20060 801-20060831~RMR*IK*47A0612**0*0~ADX*.00*IA~
ENT*4*2J*34*999999999~NM1*QE*1*FIGUEROA~RMR*11*DB0 20920002010080013644378028**0~DTM*582****RD8*20060 901-20060930~RMR*IK*47A0612**0*0~ADX*.00*IA~

Well, all the data in one record.

I apreciate if someone can help me. I only know how to use access.
Hi,

You may only know how to use Access but my guess is you might have used 'excel' as well which gives an easy approach for some prep work on your data prior to working in Access if you wish to take advantage of that and that is to open in in excel first, then use the menubar command 'Data...Text to Columns' which automatically parses out your data for you into separate columns based on a delimiter. That way you readly see how your data is presented to you as columns.

Once prepared you could then easily attach the table to Access and run a query over the top of that to extract into a new table all records where either the first three charaters equals ENT or by the looks of that data the first column would be ENT on its own anyway.

If you don't want to use excel then yes Access can do it anyway by merely linking to the datafile if it is a textfile on disk attachng it to the Access database window.

Have a look at the database window menubar command...file...get external data then select 'files of type' dropdown and then 'text file' you will be presented with a wizardry designed to ask of you how the data should be parsed into separate columns. The result is a non editable attached table presented to you in the database window from which you can extract into a new table records of your chioce based on any query you may then create on that attached table.

From the looks of that data your first column will be a three letter uppercase denotation of ENT (amongst other values) from which you can then extract all records to suit your purpose ie: SELECT * FROM My Table where column1="ENT"

Regards

Jim :)
Jan 26 '08 #2

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

Similar topics

6
by: Hari Om | last post by:
Here are the details of my error log files: I execute the command and get following message at console: ---------------------------------------------------------------------- ../sqlldr...
2
by: David Elliott | last post by:
I can create this: ?xml version="1.0" standalone="yes" ?> <ConfigOpt> <record> <Field_1>Text # 1</Field_1> <Field_2>Text # 2</Field_2> </record> </ConfigOpt>
0
by: Jonathan Fisher | last post by:
What¹s the appropriate way to create records in related, subsidiary tables when a record is created in a main table? I¹m using Access 2000, and I have a main table called tblProject, and a few...
10
by: Mark | last post by:
I have a table about people containing 25 fields. The table contains the usual fields - first, last, address, city, state and zip. There is no primary key. These fields all have data with the...
1
by: Dave | last post by:
I have a form which is based on a table (a) with over 6000 records.I have a button on this form which will open another form with related data from another table (b). What I want to do is open the...
4
by: amywolfie | last post by:
I've been trying to do something for about 3 days – I get close, but not 100%. I am trying to: Open frmRevisionHistory from a button on frmFeeInput. If there is NO RELATED RECORD, then I...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
7
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent...
14
WyvsEyeView
by: WyvsEyeView | last post by:
On my form frmTopics (bound to table tblTopics), I've added a Copy button that copies the current topic record to create a new, identical one...simple enough. However, each topic record can have 1+...
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: 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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.