Can I change the dir field during a subset operation?

From BRTT

Jump to: navigation, search
Question
Question:

Can I change the dir field during a subset operation?


Say I want to subset a database and write the new tables to a directory other than the directory where the original database resides, e.g. the command below. Now the directory part ("dir") of the path name in "crap.wfdisc" is no longer correct. Is there some way, when executing dbsubset, etc to include the absolute pathname in the new wfdisc file?


% dbsubset /export/d4/OBSIP/QDG_Passive_DMC/QDG.wfdisc "sta=='Q09' && chan=~/HH.*/" | dbjoin - site | dbunjoin -o crap -


Answer:

No.


Probably the best approach is to write the subset to the current directory, and then use dbcp to copy it somewhere else. dbcp has a variety of options for what to do with external references.

You can also often fix things up in wfdisc with a local symbolic link (so the reference works again) or by using dbset to fix the dir field. And of course, if you use absolute paths for dir, the problem doesn't arise -- but I don't recommend that.