Hey you all
I am starting with python (more familiar with shell in general)
I am trying to write a script that replaces a column in a text file with numbers (or IDs) from an other file.
Let me rephrase it :
I have 2 files: ITEMS.txt and IDs.txt
Items.txt: (Location, Item)
Store1 Shampoo
Store2 Soap
Store3 Milk
Store4 Beer
Store5 Soap
IDs.txt : (ID, Item)
1 Beer
2 Shampoo
3 Soap
4 Milk
I am trying to replace the Item column in Items.txt with the corresponding IDs to get a new file
Final.txt (Location, ID)
Store1 2
Store2 3
Store3 4
Store4 1
Store5 3
Well, the files I got are bigger than those (2 Meg for Items.txt) and searching for each line of Items.txt every line of IDs.txt is quite annoying..
Any thoughts?
Thanks