I have a text file named
train_ids.txt, and a csv file named
The text file contains ids by this way:
The input csv file has a lot of colums and rows, but the first col contains ids. The first col is as follows:
dish_1 dish_2 dish_3 dish_4 dish_5
I want to write a bash script to read the ids from the text file, and get the corresponding row which has these ids, and then put the whole row into an new csv file to be as output.
So the output csv file should be like this:
dish_1 | whatever_1 dish_5 | whatever_5
- In the output csv file, I mean by whatever the entire row
- We have to remove .png from the ids text file to be able to search
- The whole text file includes ids only as mentioned, there's no different lines
- The ids text file is sorted but the csv file isn't sorted
- ids in the text file are in the csv file for sure, so we don't need to skip or report any thing.
I don't know how to do so, could you help me?