I am using Python 3.6 with pandas and numpy. I have two CSV files, both not containing any titles (so indexing is builtin). One is a one column list with computernames: PC001 PC002 PC003 ...
The other file is an import-file for a system. It is a csv-file. And the pc name is the third column: addprinter,terminal,PC001,something,something addprinter,terminal,PC002,something,something addprinter,terminal,PC003,something,something ...
Now the import-file contains thousands of entries and i only need the line copied to a new csv (name it to-be-imported.csv) which contains the pc names from the let's call it hostnames.csv
I came "close" by using this here:
np.intersect1d(df_main[2],df_key[0])
Unfortunately it will only list then the pc names which were found in the huge csv but not listing the line which contains the name (so it could be easily written in a new csv).
I know that is to advance for me, but i am also sure i will learn much. So hopefully there is a kind soul out there understanding what i would like to do and share some guidance