in reply to Tie::File to create a Hash?
A simple solution to your problem doesn't involve perl at all. Using the shell you can achieve this in just a simple line:
$ sed 's/=/ /' complex_file | join -a 1 -1 1 -2 3 simple_file -
This works only if you have the files sorted by the joint field, e.g:
$ mv simple_file simple_file.bk; sort simple_file.bk > simple_file $ mv complex_file comple_file.bk; sed 's/=/\t/' complex_file.bk | sort + -k 3,3r | sed 's/\t/=/' > complex_file
Hope this helps!
citromatik
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tie::File to create a Hash?
by LittleGreyCat (Scribe) on May 31, 2007 at 15:26 UTC |