Hi cmccabe ,
In post #1, you said that the desired output from your two sample input files is:
Given that there is no record in file2 that contains the file1 field 2 values as a coding value in the single-quoted sub-subfields of field 8 in file2 why were the values show in red in the above output selected as the desired output? (I note that the output produced by the perl script durden_tyler suggested omits that field from the output and you didn't comment on that discrepancy.)
Other than having no idea how the 3rd output field in the first two records of your desired output is supposed to be selected, I think I can come up with an awk script that does what you want just using standard awk features (without the gawk extensions your current code is trying to use).
This User Gave Thanks to Don Cragun For This Post:
Hi Friends,
I have a file with the following values..
xyz.txt,12345.xml
abc.txt,04567.xml
cde.txt,12134.xml
I would like to extract all the 2nd column values twice as shown in the example like
12345,12345.xml
04567,04567.xml
12134,12134.xml
Please advice!!
In the formus one of... (7 Replies)
I have read another post about this issue and am wondering how to adapt it
to my own, much simpler, issue.
I have a file of user IDs like so:
333333
321321
546465
...etc
I need to take each number and use it to print records wherein the 5th
field matches the user ID pulled from the... (2 Replies)
Hi everyone,
I have file1 and file2 comma separated both.
file1 is:
Header1,Header2,Header3,Header4,Header5,Header6,Header7,Header8,Header9,Header10
Code7,,,,,,,,,
Code5,,,,,,,,,
Code3,,,,,,,,,
Code9,,,,,,,,,
Code2,,,,,,,,,file2... (17 Replies)
Hello friends,
I have a text file with many columns (no. columns vary from row to row) separated by space. I need to collect all the values from 18th column to the end from each line and group them as pairs and then numbering like below..
1. 18th-col-value 19th-col-value 2. 20th-col-value ... (5 Replies)
In the below awk I am trying to print expName only if another tag planExecuted is true. In addition to the expName I am also printing planShortID. For some reason the word experiment gets printed so I remove it with sed. I have attached the complete index.html as well as included a sample of it... (1 Reply)
The below awk is used with the attached index.html and matches the specific user id in the sub portion with path of /rundb/api/v1/plugin/49/. The command does run but the output is blank. Something changed in the file structure as it used to work.
So using the first line in the output:
... (2 Replies)
I am trying to use awk to match the NM_ in file with $1 of id which is tab-delimited. The NM_ will always be in the line of file that starts with > and be after the second _. When there is a match between each NM_ and id, then the value of $2 in id is substituted or used to update the NM_. Each NM_... (3 Replies)
I am trying to use awk to find all the $2 values in file2 which is ~30MB and tab-delimited, that are between $2 and $3 in file1 which is ~2GB and tab-delimited.
I have just found out that I need to use $1 and $2 and $3 from file1 and $1 and $2of file2 must match $1 of file1 and be in the range... (6 Replies)
In the awk below which executes as is, I am trying to add a condition that will extract the text or
value after the FR= for the lines in each line of file1 compared
to file2. As is the lines between the two files are either a match, Missing in file 1, or Missing in file2,
but I can not add the... (1 Reply)
Discussion started by: cmccabe
1 Replies
LEARN ABOUT OSF1
usync
usync(8) System Manager's Manual usync(8)NAME
usync - synchronize two setld inventory files to reflect current system status
SYNOPSIS
/usr/lbin/usync [-d] file1 file2
OPTIONS
Enables debugging. This will print the pairs of pathnames being synchronized on the standard output.
DESCRIPTION
The usync command is used to achieve inventory synchronization by merging two inventory files according to the pathname field of the inven-
tory records. The result is directed to standard output.
If the two inventory files contain records with the same pathname, the record in file2 is written and the record in file1 is ignored. If
either inventory file contains a pathname not present in the other file, the record containing that pathname is written to standard output.
To reflect the current system inventory, file2 should represent a later installation than file1.
RESTRICTIONS
The two inventory files must be sorted in ascending ASCII sequence on the pathname field.
ERRORS
usync: file is corrupt
Explanation:
Records in one of the inventory files are not sorted properly.
EXAMPLES
The following command produces a synchronized inventory for two versions of the OATDCB subset: /usr/lbin/usync OATDCB100.inv OATDCB120.inv
FILES
Subset inventory files
SEE ALSO stl_inv(4)
Programming Support Tools
usync(8)