HI,
I'm having trouble constructing a shell script using the awk command
to solve my problem.
Problem:
I have two csv-files which look something like the following
A small file (file1.csv)
Code:
$ head -2 file1.csv
"data13a","data13b","name13"
"data21a","data21b","name21"
And a large one (file2.csv)
Code:
$ head -3 file2.csv
"username1","name1"
"username2","name2"
"username3","name3"
and so on
file1.csv contains information about a group of users
file2.csv contains information about all users
Does anyone know howto create a new file (file3.csv) containing a list of usernames and names of the persons listed in file1.csv like this?
Code:
$ head -2 file3.csv
"username13","name13"
"username21","name21"
I'm thinking about using awk to find the right lines in file2.csv and print them to file3.csv, but I have some trouble using fields from the lines in file1.csv as an awk search pattern.
Can anybody offer me some help?
Thanks.