Merging specifc lines of three files into one?

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.
  1. 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

This sounds like a homework assignment. Homework and coursework questions can only be posted in the Homework & Coursework Questions forum and must include a completely filled out homework template that is included in the special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

If this is not a homework assignment, please explain the reason for doing this project and include more information, including, but not necessarily limited to:

  • the operating system you're using,
  • the shell you're using,
  • sample input data (in CODE tags), and
  • sample desired output data (in CODE tags).