S00999999|BHANU|TEST|007 JOHN DOE APT 999||VENGA HIGHWAY|MA|09566|SCO DUAL|20140201|20140331|20140401|20140630|20140327|
S00888888|BU|TES|009 JOHN DOE APT 909||SENGA HIGHWAY|MA|08566|SCO DUAL|20140301|20140430|20140501|20140731|20140327|
S00888876|BUT|TESY|004 JOHN DOE APT 919||BENGA HIGHWAY|MA|06566|SCO DUAL|20131201|20140131|20140201|20140430|20140327|
File 2 :
Code:
S00375383|GEORGIA|KAMELAKIS|PO BOX 705||YARMOUTHPORT|MA|02675|SCO DUAL|20140201||20140331|20140401|20140228|
S00999999|BHANU|TEST|007 JOHN DOE APT 999||VENGA HIGHWAY|MA|09566|SCO DUAL|20140201||20140331|20140401|20131027|
S00888876|BUT|TESY|004 JOHN DOE APT 919||BENGA HIGHWAY|MA|06566|SCO DUAL|20140201||20140331|20140401|20131027|
I need to compare 1st column of both files and replace all values from File 1 into File 2 where they match and also print the original lines of non-matching columns.
Output file :
Code:
S00375383|GEORGIA|KAMELAKIS|PO BOX 705||YARMOUTHPORT|MA|02675|SCO DUAL|20140201||20140331|20140401|20140228|
S00999999|BHANU|TEST|007 JOHN DOE APT 999||VENGA HIGHWAY|MA|09566|SCO DUAL|20140201|20140331|20140401|20140630|20140327|
S00888876|BUT|TESY|004 JOHN DOE APT 919||BENGA HIGHWAY|MA|06566|SCO DUAL|20131201|20140131|20140201|20140430|20140327|
I tried this through different awk commands but did not help :
Code:
awk 'FNR==NR{a[$0];next} !($1 in a)' file1 file 2
awk 'FNR==NR { a[$1]=$2; next } $1 in a { print $1, a[$1], $2, $3, $4, $5, $6, $7 }' file1 file 2
Hi, I need help to write a korn shell script to
1. Check and compare the first file contains single record from the /scp/inbox directory against the badpnt.dat file from the pnt/badfiles directory contains multiple records based on the fam_id column value start at position 38 to 47 from the... (7 Replies)
Hi,
I have a file which contains names with counts for eg:
0622 0031 JOHN MAX 20080622003104. STAT 1.
0622 0031 BILL MAX 20080622003104. STAT 7.
and I have an exception file containing.
BILL
Can anyone help to write a script... (7 Replies)
Hi
i want to compare files
a.txt
12345,23
34567,76
65456,10
13467,01
b.txt
12346,23
34567,76
23333,90
65456,10
13467,03
i want o/p in 3 files
common.txt
both have (2 Replies)
Here is my situation. I need to compare two tab separated files (diff is not useful since there could be known difference between files).
I have found similar posts , but not fully matching.I was thinking of writing a shell script using cut and grep and while loop but after going thru posts it... (2 Replies)
Hi,
I am writing a comparator script, which comapre two txt files(column by column)
below are the precondition of this comparator
1)columns of file are not seperated
Ex.
file1.txt
8888812341181892
1243548895685687
8945896789897789
1111111111111111
file2.txt
9578956789567897... (2 Replies)
hi Friends
need to compare columns in one file where the data looks like below
laptop,IBM
phone,samsung
car,rental
user1,laptop
user2,laptop
user3,phone
want to get output as
laptop,IBM
phone,samsung
car,rental
user1,IBM
user2,IBM
user3,samsung
need to seach $2 in array of $1 and... (4 Replies)
Hi All I am just trying to compare 2 file using column information using following code
awk '
NR==FNR {A=$9; next}
{B=A; print $0,B""?B:" Not -In file" }
' OFS="\t" file1 file2if file1 matches with file2 then print $9 content in file 1 along with file2 $0 suppose if I keyed on only $1 in... (17 Replies)
Hi all,
I have two two-column tab-separated files with the following input:
inputA
dog A
dog B
cat A....
inputB
dog C
mouse A
output
dog
I need to compare the 1st column of each file and output those shared items.
What is the best unix solution for that? (5 Replies)
Hello,
I have two text tab delimited files
File 1 has 30 columns. I am pasting only first 9
Chr Position Ref Alt Score Gene HGVS_C HGVS_P Coding_Consequence dbSNP
1 17312743 C T 1 Gene1 - ... (2 Replies)
Example:
I have files in below format
file 1:
zxc,133,joe@example.com
cst,222,xyz@example1.com
File 2 Contains:
hxd
hcd
jws
zxc
cst
File 1 has 50000 lines and file 2 has around 30000 lines :
Expected Output has to be :
hxd
hcd
jws (5 Replies)
Discussion started by: TestPractice
5 Replies
LEARN ABOUT LINUX
apt-sortpkgs
APT-SORTPKGS(1) APT APT-SORTPKGS(1)NAME
apt-sortpkgs - Utility to sort package index files
SYNOPSIS
apt-sortpkgs [-hvs] [-o=config string] [-c=file] file...
DESCRIPTION
apt-sortpkgs will take an index file (Source index or Package index) and sort the records so that they are ordered by the package name. It
will also sort the internal fields of each record according to the internal sorting rules.
All output is sent to stdout, the input must be a seekable file.
OPTIONS
All command line options may be set using the configuration file, the descriptions indicate the configuration option to set. For boolean
options you can override the config file by using something like -f-,--no-f, -f=no or several other variations.
-s, --source
Use Source index field ordering. Configuration Item: APT::SortPkgs::Source.
-h, --help
Show a short usage summary.
-v, --version
Show the program version.
-c, --config-file
Configuration File; Specify a configuration file to use. The program will read the default configuration file and then this
configuration file. If configuration settings need to be set before the default configuration files are parsed specify a file with the
APT_CONFIG environment variable. See apt.conf(5) for syntax information.
-o, --option
Set a Configuration Option; This will set an arbitrary configuration option. The syntax is -o Foo::Bar=bar. -o and --option can be
used multiple times to set different options.
SEE ALSO apt.conf(5)DIAGNOSTICS
apt-sortpkgs returns zero on normal operation, decimal 100 on error.
BUGS
APT bug page[1]. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command.
AUTHORS
Jason Gunthorpe
APT team
NOTES
1. APT bug page
http://bugs.debian.org/src:apt
Linux 29 February 2004 APT-SORTPKGS(1)