Hello,
I have not been able to find what I'm looking for via searching the forum. I could use some help with an awk script or one-liner to solve this simple problem.
I have two files. If $1 and $2 from file1 match $1 and $2 from file2, print the whole line from file2.
Example file1
... (2 Replies)
Hello. I have two files. FILE1 was extracted from FILE2 and modified thanks to help from this post. Now I need to replace the extracted, modified lines into the original file (FILE2) to produce the FILE3.
FILE1
1466 55.27433 14.72050 -2.52E+03 3.00E-01 1.05E+04 2.57E+04
1467 55.27433... (1 Reply)
Hi
I have file 1 like this
and file 2 like this
I need to compare column 3 of both files and delete lines in file1 with same column 3 values in two files. So the output is
I tried with perl but didnt work. A perl code will be good as I am learning the language, but any other code would... (1 Reply)
Hi dear users,
I need to compare numeric columns in two files. These files have the following structure.
K.txt (4 columns)
A001 chr21 9805831 9846011
A002 chr21 9806202 9846263
A003 chr21 9887188 9988593
A003 chr21 9887188 ... (2 Replies)
Hi,
I want to compare the columns of two files excluding column 2 from both the files. I tried this awk command.
awk -F":" 'NR==FNR{++a;next} !(a)' file1.txt file2.txt
.
Example: File1.txt
123:09-15-2011:abc:123456
123:09-15-2011:abc:234567
123:09-15-2011:abc:345678
... (5 Replies)
Hi,
I want to compare two columns from file1 with another two column of file2 and print matched and unmatched column like this
File1
1 rs1 abc
3 rs4 xyz
1 rs3 stu
File2
1 kkk rs1 AA 10
1 aaa rs2 DD 20
1 ccc ... (2 Replies)
Hi all, I'm pretty much a newbie to UNIX. I would appreciate any help with UNIX coding on comparing two large csv files (greater than 10 GB in size), and output a file with matching columns.
I want to compare file1 and file2 by 'id' and 'chain' columns, then extract exact matching rows'... (5 Replies)
Hi,
Below is my requirement
file1
id|cnt
1|1
2|2
3|3
file2
id_1|cnt_1
1|1
2|1
3|1
I want to compare cnt and cnt_1 columns, if they are differ then give the details
Am using below awk command, but the output is not as expected. (2 Replies)
Discussion started by: grandhirahuletl
2 Replies
LEARN ABOUT DEBIAN
urifind
URIFIND(1p) User Contributed Perl Documentation URIFIND(1p)NAME
urifind - find URIs in a document and dump them to STDOUT.
SYNOPSIS
$ urifind file
DESCRIPTION
urifind is a simple script that finds URIs in one or more files (using "URI::Find"), and outputs them to to STDOUT. That's it.
To find all the URIs in file1, use:
$ urifind file1
To find the URIs in multiple files, simply list them as arguments:
$ urifind file1 file2 file3
urifind will read from "STDIN" if no files are given or if a filename of "-" is specified:
$ wget http://www.boston.com/ -O - | urifind
When multiple files are listed, urifind prefixes each found URI with the file from which it came:
$ urifind file1 file2
file1: http://www.boston.com/index.html
file2: http://use.perl.org/
This can be turned on for single files with the "-p" ("prefix") switch:
$urifind -p file3
file1: http://fsck.com/rt/
It can also be turned off for multiple files with the "-n" ("no prefix") switch:
$ urifind -n file1 file2
http://www.boston.com/index.html
http://use.perl.org/
By default, URIs will be displayed in the order found; to sort them ascii-betically, use the "-s" ("sort") option. To reverse sort them,
use the "-r" ("reverse") flag ("-r" implies "-s").
$ urifind -s file1 file2
http://use.perl.org/
http://www.boston.com/index.html
mailto:webmaster@boston.com
$ urifind -r file1 file2
mailto:webmaster@boston.com
http://www.boston.com/index.html
http://use.perl.org/
Finally, urifind supports limiting the returned URIs by scheme or by arbitrary pattern, using the "-S" option (for schemes) and the "-P"
option. Both "-S" and "-P" can be specified multiple times:
$ urifind -S mailto file1
mailto:webmaster@boston.com
$ urifind -S mailto -S http file1
mailto:webmaster@boston.com
http://www.boston.com/index.html
"-P" takes an arbitrary Perl regex. It might need to be protected from the shell:
$ urifind -P 's?html?' file1
http://www.boston.com/index.html
$ urifind -P '.org' -S http file4
http://www.gnu.org/software/wget/wget.html
Add a "-d" to have urifind dump the refexen generated from "-S" and "-P" to "STDERR". "-D" does the same but exits immediately:
$ urifind -P '.org' -S http -D
$scheme = '^(http):'
@pats = ('^(http):', '.org')
To remove duplicates from the results, use the "-u" ("unique") switch.
OPTION SUMMARY -s Sort results.
-r Reverse sort results (implies -s).
-u Return unique results only.
-n Don't include filename in output.
-p Include filename in output (0 by default, but 1 if multiple files are included on the command line).
-P $re
Print only lines matching regex '$re' (may be specified multiple times).
-S $scheme
Only this scheme (may be specified multiple times).
-h Help summary.
-v Display version and exit.
-d Dump compiled regexes for "-S" and "-P" to "STDERR".
-D Same as "-d", but exit after dumping.
AUTHOR
darren chamberlain <darren@cpan.org>
COPYRIGHT
(C) 2003 darren chamberlain
This library is free software; you may distribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
URI::Find
perl v5.14.2 2012-04-08 URIFIND(1p)