I need help on merging 2 input files into one combined output.
Here's my input data file:
1111 100 sdfsdf sdfsdf etc.
1111 101 sdfsdf sdfsdf etc.
1111 102 sdfsdf sdfsdf etc.
1111 103 sdfsdf sdfsdf etc.
1111 110 sdfsdf sdfsdf etc.
1111 999 sdfsdf sdfsdf etc.
2222 0 sdfsdf sdfsdf etc.
2222 1 sdfsdf sdfsdf etc.
2222 10A sdfsdf sdfsdf etc.
3333 1 sdfsdf sdfsdf etc.
Here's my control file that is comma delimited:
aaaa,1111,100,999
bbbb,2222,0,10A
cccc,3333,1,1
and here's the combined output: space delimited
aaaa 1111 100 sdfsdf sdfsdf
aaaa 1111 101 sdfsdf sdfsdf
aaaa 1111 102 sdfsdf sdfsdf
aaaa 1111 103 sdfsdf sdfsdf
aaaa 1111 110 sdfsdf sdfsdf
aaaa 1111 999 sdfsdf sdfsdf
bbbb 2222 0 sdfsdf sdfsdf
bbbb 2222 1 sdfsdf sdfsdf
bbbb 2222 10A sdfsdf sdfsdf
cccc 3333 1 sdfsdf sdfsdf
All I need the script to do is to check for the similarity on the 3 fields in the control file and match with the first 2 fields of the data file and then append the first field of the control file to the data file.
The control file is a range of begining and end points for each group or it could be a single point, as in the case of cccc,3333,1,1
Thanks
Here's my input data file:
1111 100 sdfsdf sdfsdf etc.
1111 101 sdfsdf sdfsdf etc.
1111 102 sdfsdf sdfsdf etc.
1111 103 sdfsdf sdfsdf etc.
1111 110 sdfsdf sdfsdf etc.
1111 999 sdfsdf sdfsdf etc.
2222 0 sdfsdf sdfsdf etc.
2222 1 sdfsdf sdfsdf etc.
2222 10A sdfsdf sdfsdf etc.
3333 1 sdfsdf sdfsdf etc.
Here's my control file that is comma delimited:
aaaa,1111,100,999
bbbb,2222,0,10A
cccc,3333,1,1
and here's the combined output: space delimited
aaaa 1111 100 sdfsdf sdfsdf
aaaa 1111 101 sdfsdf sdfsdf
aaaa 1111 102 sdfsdf sdfsdf
aaaa 1111 103 sdfsdf sdfsdf
aaaa 1111 110 sdfsdf sdfsdf
aaaa 1111 999 sdfsdf sdfsdf
bbbb 2222 0 sdfsdf sdfsdf
bbbb 2222 1 sdfsdf sdfsdf
bbbb 2222 10A sdfsdf sdfsdf
cccc 3333 1 sdfsdf sdfsdf
All I need the script to do is to check for the similarity on the 3 fields in the control file and match with the first 2 fields of the data file and then append the first field of the control file to the data file.
The control file is a range of begining and end points for each group or it could be a single point, as in the case of cccc,3333,1,1
Thanks