Since you mention Stata, SAS and awk, a non-perl solution's acceptable? Since you've got awk, you're on a unix system? Are you aware of join?
Caveats: the files must be sorted, and it'll only join on one field, so you'ld need to prepare the files:
The advantage of this over the perl version is that somebody else has already gone to the trouble of allowing all those useful command line options, to allow you to join on fields other than the first, or to output something other than the complete set of fields. Or, possibly more useful to your case: to include all the lines which don't match.tail +2 d1.dat | sort | sed 's/ /:/' > d1.sorted tail +2 d2.dat | sort | sed 's/ /:/' > d2.sorted join d1.sorted d2.sorted | sed 's/:/ /'
And anyway, it never hurts to know about something else perl can render obsolete ;-)
In reply to Re: merging to databases... Should be easy...
by tommyw
in thread merging to databases... Should be easy...
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |