I have 3 text files
- many lines of
value1<tab>value2(maybe 600) - many more lines of
value2<tab>value3(maybe 1000) - many more lines of
value2<tab>value4(maybe 2000)
Not all lines match, some will have one or more vals missing. I want to take file 1, read down it and lookup corresponding values in files 2 & 3, and write the output as – for example
value1<tab>value2<tab>value3<tab>value4
value1<tab>value2<tab>blank <tab>value4
i.e. indicate that the value is missing by printing a bit of text
in awk I can BEGIN by reading the files into arrays up front then END and step through them. But I want to use Python (3) for portability. I do it on a pc using MS Access and linking tables but there is a time penalty for each time I use this method.
All efforts to understand this in dictionaries or lists have confused me. I now seem to have every Python book!
Many thanks to anyone who can offer advice. (if interested, it’s arp, mac and vendor codes)
Start with this.
You may want to customize it to change the formatting of the output.