Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.stsci.edu/spst/lrpg/man_txt/ljoin.txt
Дата изменения: Fri Apr 8 22:30:25 2011
Дата индексирования: Sat Mar 1 09:01:21 2014
Кодировка:

Поисковые слова: green flash



User Commands LJOIN(1)



NAME
ljoin - merge records from two files using a user-supplied
regular expression or key.


SYNOPSIS:
ljoin -{v} -{q} -{k|#} -{n} -{[1]|2|b} -{A} -{0} -{s "user-
specsepchars"} -{i <#>} -[[x|P]|[y|S]|p ["user pattern or
string"] ]


INTRODUCTION:
The tool ljoin (a monicker derived from its functionality
'LRP join') merges single line records from different files
based upon a user specified key or regular expression.
ljoin is particularly adapted to matching records with
prop_ids and sunit_ids in them (HST LRP group).

Suppose one file has LRP information (such as an available
report) for a set of visits and another file has proposal or
sunit information derived from some other source (such as
proposal title and PI information or something else), then
ljoin can stitch the records from the two files together and
output the combined result.

As a specific example, suppose we wished to match an
unschedulable records file (fileA) with 'available' informa-
tion in another (fileB).

unixprompt> ljoin -b -P fileA fileB

The '-b' tells ljoin to spit out both records matched from
each file, while '-P' tells it to match via prop_id (use '-
S' if you wanted to match on sunit_id assuming both files
have this in their records). If you only wanted to see
records from the first file that matched with the 2nd file,
then you would use '-1'; to report records only from the 2nd
file that match with those from the first, then use '-2'.
There are also other options to:

-- change the "match join" character that separates
the merged
lines.
-- report records from fileA that do not have
matches in fileB
-- print only the matching keys (e.g, prop_ids or
sunit_ids)
-- print matching keys and a frequency of occurrence
table.
-- use an alternate text or python regular expres-
sion for
matching.



SunOS 5.10 Last change: 17 June 2009 1






User Commands LJOIN(1)



-- insert the second file's record as a specific
column within the
record matched from the first.

Running just the tool name on the command line gives the
options/syntax.

Usage: unixprompt> ljoin -{v} -{q} -{k#} -{n} -{A} -{[1]2b}
-{0} -{s "userspecsepchars"} -{i <#>}
-[[x|P]|[y|S]|p ["user pattern or string"]
]

Where the options are:

Verbosity:
-q : quiet--do not print out the ljoin parameters
before performing the join.
-v : verbose.

Match negation:
-n : print records/keys from one file where no keys
from the other file file match.

Print keys or records:
-A : print lines from either file whether a match
or not.
-k : print matching keys from corresponding file
rather than records.
-# : print matching keys and their frequency of
occurrence, ....

Which file's records get printed:
-[1|2|b] : print records/keys from 1st, 2nd, or both
files for match (or nonmatch if -n).

Pattern to match:
-p : required pattern to search for (may be text or
regular expression).
-[x|P] : use prop_id regular expression pattern (con-
venient shortcut).
-[y|S] : use sunit_id regular expression pattern (con-
venient shortcut).

Field separators:
-i : insert the second record into position #
within the first record.
-0 : don't use the default separation characters '
^ '; instead use nothing.
-s : use the specified separation characters.

[




SunOS 5.10 Last change: 17 June 2009 2






User Commands LJOIN(1)



NOTES AND CAUTIONS:
The flexibility of the key matching might be a bit limited
and there are circumstances where it might not match based
upon the characters around the regular expression, prop_id,
or sunit_id, and if you find this, please let me know so i
can enhance its recognition ability.


BUGS:
REVISION HISTORY:
09-01-16 ij Fixed shortcoming in prop_id regular expres-
sion. 09-06-17 ij Fixed the 'non-match' capability.


CALLS USED:
python tool with standard libraries.


AUTHOR
i. jordan



































SunOS 5.10 Last change: 17 June 2009 3