Hi, I receive a file that has Master record followed by one/more Child Records as shown below & also as attached in the file.
Now , The key for the child record is from pos 4 to position 80 in the parent record, now the requirement is to create two files
1. Parent file --> has all the parent records
2. Child file --> Has the key from the parent + Remarks i.e RMK TEST LINE 1 etc
can someone please help immediately?
ALT 00623047371 20120213021520120320195216PADVN2012032015520003543ATL
RMK TEST LINE 1
ALT 00623047371 20120213021520120320195246PADVR2012032015520003543ATL
RMK TEST LINE 1
RMK TEST LINE 2
ALT 00623053520 20120306041920120320195927PADRY2012032015590003543ATL
RMK THIS IS A TEST FOR CODE RED LINE 1
RMK THIS IS A TEST FOR CODE RED LINE 2
RMK THIS IS A TEST FOR CODE RED LINE 3
RMK THIS IS A TEST FOR CODE RED LINE 4
RMK THIS IS A TEST FOR CODE RED LINE 5
RMK THIS IS A TEST FOR CODE RED LINE 6
RMK THIS IS A TEST FOR CODE RED LINE 7
RMK THIS IS A TEST FOR CODE RED LINE 8
RMK THIS IS A TEST FOR CODE RED LINE 9
Output should be
Parent file or altparent.txt
ALT 00623047371 20120213021520120320195216PADVN2012032015520003543ATL
ALT 00623047371 20120213021520120320195246PADVR2012032015520003543ATL
ALT 00623053520 20120306041920120320195927PADRY2012032015590003543ATL
Child file or atlchild.txt --> should be a fixed width file having padded with spaces if required at the end.
RMK 00623047371 20120213021520120320195216TEST LINE 1
RMK 00623047371 20120213021520120320195246TEST LINE 1
RMK 00623047371 20120213021520120320195246TEST LINE 2
RMK 00623053520 20120306041920120320195927THIS IS A TEST FOR CODE RED LINE 1
RMK 00623053520 20120306041920120320195927THIS IS A TEST FOR CODE RED LINE 2
RMK 00623053520 20120306041920120320195927THIS IS A TEST FOR CODE RED LINE 3
RMK 00623053520 20120306041920120320195927THIS IS A TEST FOR CODE RED LINE 4
RMK 00623053520 20120306041920120320195927THIS IS A TEST FOR CODE RED LINE 5
RMK 00623053520 20120306041920120320195927THIS IS A TEST FOR CODE RED LINE 6
RMK 00623053520 20120306041920120320195927THIS IS A TEST FOR CODE RED LINE 7
RMK 00623053520 20120306041920120320195927THIS IS A TEST FOR CODE RED LINE 8
RMK 00623053520 20120306041920120320195927THIS IS A TEST FOR CODE RED LINE 9
Hi,
I was wandering would it be possible to split the record dynamically based on the certain values, for an instance
i have a file with record with predefined split value i.e 10
col1 col2 col3 col4
------------------------
aaaa bbbb 2 44aaaabbbb55cccddd1110
mmn xnmn 3... (6 Replies)
HI,
I have a pipe delimiter file , I have to search for second field pattern, if the second field does not contain a '-' , I need to start capturing the record from this line till I find another second field with '-' value.
Below is the sample data
SOURCE DATA
ABC|ABC_702148-PARAM... (3 Replies)
Hi All,
I want my file to be split based on value of 'N' (passed as argument). If value of 'N' is '2' then 4 new files will be generated from the below source file and the o/p file shoud look like File_$num , where num will be incremental.
Source file:
1
2
3
4
5
O/p Files:
... (6 Replies)
Hi All,
I am trying to split a record into multiple records based on a value.
Input.txt
"A",1,0,10
"B",2,0,10,15,20
"C",3,11,14,16,19,21,23
"D",1,0,5
My desired output is:
"A",1,0,10
"B",2,0,10
"B",2,15,20
"C",3,11,14
"C",3,16,19
"C",3,21,23 (4 Replies)
I have a flat file with 2 columns
Id,loc
1,nj:ny:pa
2,pa
3,ca:tx:fl:nj
Second colum data is seperated by semi colon and can i have many locations for one id
Output i need is
1,nj
1,ny
1,pa
1,pa
3,ca
3,tx
3,fl (1 Reply)
I have to split a file based on number of lines and the below command works fine:
split -l 2 Inputfile -d OutputfileMy input file contains header, detail and trailor info as below:
H
D
D
D
D
TMy split files for the above command contains:
First File:
H
DSecond File:
... (11 Replies)
Hi
I have a file
$cat test
a,1;2;3
b,4;5;6;7
c,8;9
I want to split each record to multiple based on semicolon in 2nd field.
i.e
a,1
a,2
a,3
b,4
b,5 (3 Replies)
I have an application desigend in PHP and MySQl running on apache web server that I is running on a Amazon EC2 server Centos. I want to implement the master-master and master slave replication and high availability disaster recovery on this application database.
For this I have created two... (0 Replies)
Hi,
I have one tab delimited file which is having multiple store_ids in first column seprated by pipe.I want to split the file on the basis of store_id(separating 1st record in to 2 records ).
I tried some more options like below with using split,awk etc ,But not able to get proper output. can... (1 Reply)
Hi Forum.
I have this challenging issue that I'm hoping someone can help me.
I have a file that contains 3 different types of segments (AM00, AM01, AM32) in a hierarchy structure and I want to be able to pass the column key from the parent record to the children records.
AM00 - parent key:... (13 Replies)