Not sure if this is the correct forum for this question. I have two files. file1.zip, file2
Input:
file1.zip
col1, col2 , col3
a , b , 0:0:0:0:0:c436:9346:d40b
x, y, 0:0:0:0:0:880:39f9:c9a7
m, n , 0:0:0:0:0:80c7:9161:fe00
file2.txt
col1
c4:36:93:46:d4:0b
08:80:39:f9:c9:a7
48:1d:60:62:f5:9d
I need to
- Convert col3 in file1 to col1 in file2 format i.e., ab:cd:ef:gh:ij:kl by padding 0's for and using semicolon':' for every 2 characters after trimming first 10 char.
- compare it with col1 in table B and store the matching columns required output for the above scenario
col1 , col2, col3
a , b , c4:36:93:46:d4:0b
x , y , 08:80:39:f9:c9:a7
I have 1500 zip files and one reference file. Not sure how to achieve this in unix. Can someone please help.
for direct files, I used
ls *.zip | awk '{ print "zipgrep -f file2.txt "$0" >> result.csv"}' | xargs -I {}