Recall that nc-county-pop.dat
has 100 lines, and each line corresponds to a county. The files girls.dat
and boys.dat
each has 50 lines. Assume that the girls come from the first 50 counties and each county has only one girl. That is the first girl comes from the first county, the second girl comes from the second county, and so on. Similarly, assume that the boys come from the last 50 counties and each county has only one boy. That is the first boy comes from the $51 county, the second boy comes from the $52 county, and so on.
Produce a file that has two columns, where the first column is the name of the girl/boy and the second column is the name of the county. The order of the names of girls, boys, and county names must be in the same order of their occurrence in the corresponding data files.
- I thought the first file would be something like
join -1 1 -2 1 -t "#" -o '2.1 1.1' girls.dat nc-county-pop.dat