Hi,
I have 2 files. On of them
filea contains
------
field1,field2,.. ,field4,...
001200,001200,001200,001200,6,9,001200,ESTADOSUNIDOS,ESTADOSUNIDOS,001200
001200,001200,001200,001201,6,9,001200,ESTADOSUNIDOS,ESTADOSUNIDOS,001200
001200,001200,001200,001202,6,9,001200,ESTADOSUNIDOS,ESTADOSUNIDOS,001200
001200,001200,001200,001203,6,9,001200,ESTADOSUNIDOS,ESTADOSUNIDOS,001200
001204,001204,001204,001204,6,9,001204,CANADA,CANADA,001204
Filed4 (series) is variable, and the field 5 contains the length of field4.
and fileb contains
------------------
field1
012000059 042213997 0507301019480507301022390002800029BOGOAXE2AUP00000200319211110011CE12D7IMED2X7O00000C000 0000000000251
012000059 042554019 0507301927250507301935570008500086BOGOAXE1AUP00000594046211110011CEN2D7IMED5H7O00000C000 0000000000832
012000132 018920468
I want to make a join between field4 (filea) and substr(field1,1,18) (fileb) and obtain a file with this structure
if (field4(file_a) in substr(field1(file_b),1,field5(file_a)))
{
print $0(file_b),field8(file_a),field9(file_a)
}
else{print $0(file_a) > "Is not here"}
Thanks
malpa
I have 2 files. On of them
filea contains
------
field1,field2,.. ,field4,...
001200,001200,001200,001200,6,9,001200,ESTADOSUNIDOS,ESTADOSUNIDOS,001200
001200,001200,001200,001201,6,9,001200,ESTADOSUNIDOS,ESTADOSUNIDOS,001200
001200,001200,001200,001202,6,9,001200,ESTADOSUNIDOS,ESTADOSUNIDOS,001200
001200,001200,001200,001203,6,9,001200,ESTADOSUNIDOS,ESTADOSUNIDOS,001200
001204,001204,001204,001204,6,9,001204,CANADA,CANADA,001204
Filed4 (series) is variable, and the field 5 contains the length of field4.
and fileb contains
------------------
field1
012000059 042213997 0507301019480507301022390002800029BOGOAXE2AUP00000200319211110011CE12D7IMED2X7O00000C000 0000000000251
012000059 042554019 0507301927250507301935570008500086BOGOAXE1AUP00000594046211110011CEN2D7IMED5H7O00000C000 0000000000832
012000132 018920468
I want to make a join between field4 (filea) and substr(field1,1,18) (fileb) and obtain a file with this structure
if (field4(file_a) in substr(field1(file_b),1,field5(file_a)))
{
print $0(file_b),field8(file_a),field9(file_a)
}
else{print $0(file_a) > "Is not here"}
Thanks
malpa