Sponsored Content
Top Forums UNIX for Dummies Questions & Answers how to find common words and take them out from two files Post 302288370 by Whiteboard on Tuesday 17th of February 2009 04:55:39 AM
Old 02-17-2009
Code:
 
$ cat xxx.txt
A 1 2 3 4 5
C 1 2 3 4 5
E 1 2 3 4 5
 
$ cat yyy.txt
A 1 2 3 4 5
B 1 2 3 4 5
C 1 2 3 4 5
D 1 2 3 4 5
E 1 2 3 4 5
 
 
$ grep -f xxx.txt yyy.txt
A 1 2 3 4 5
C 1 2 3 4 5
E 1 2 3 4 5

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To find all common lines from 'n' no. of files

Hi, I have one situation. I have some 6-7 no. of files in one directory & I have to extract all the lines which exist in all these files. means I need to extract all common lines from all these files & put them in a separate file. Please help. I know it could be done with the help of... (11 Replies)
Discussion started by: The Observer
11 Replies

2. Shell Programming and Scripting

Files common in two sets ??? How to find ??

Suppose we have 2 set of files set 1 set 2 ------ ------ abc hgb def ppp mgh vvv nmk sdf hgb ... (1 Reply)
Discussion started by: skyineyes
1 Replies

3. Shell Programming and Scripting

search of common words in set of files

Hi, I have a set of simple, one columned text files (in thousands). file1: a b c d file 2: b c d e and so on. There is a collection of words in another file: b d b c d e I have to find out the set of words (in each row) is present or absent in the given set of files. So, the... (4 Replies)
Discussion started by: mala
4 Replies

4. Shell Programming and Scripting

Script to find NOT common strings in two files

Hi all, I'd like you to help or give any advise about the following: I have two (2) files, file1 and file2, both files have information common to each other. The contents of file1 is a subset of the contents of file2: file1: errormsgadmin esdp esgservices esignipa iprice ipvpn irm... (0 Replies)
Discussion started by: hnux
0 Replies

5. Shell Programming and Scripting

Extract common words from two/more csv files

I have two (or more, to make it generic) csv files. Each line contains words separated by comma. None of words have any space. The number of words per line is not fixed. Some may have one, and some may have 12... The number of lines per file is also not fixed. What I need is to find common words... (1 Reply)
Discussion started by: nick2011
1 Replies

6. Shell Programming and Scripting

Find Common Values Across Two Files

Hi All, I have two files like below: File1 MYFILE_28012012_1112.txt|4 MYFILE_28012012_1113.txt|51 MYFILE_28012012_1114.txt|57 MYFILE_28012012_1115.txt|57 MYFILE_28012012_1116.txt|57 MYFILE_28012012_1117.txt|57 File2 MYFILE_28012012_1110.txt|57 MYFILE_28012012_1111.txt|57... (2 Replies)
Discussion started by: angshuman
2 Replies

7. Shell Programming and Scripting

Find common words

Hi, I have 10 files which needs to be print common words from those all files. Is there any command to find out. (2 Replies)
Discussion started by: munna_dude
2 Replies

8. UNIX for Dummies Questions & Answers

Find a file with common initials and last words

Hi, I have a requirement like i have to find out files and remove them on a daily basis. The files are generated as abc_jnfn_201404230004.csv abc_jnfo_201404230004.csv abc_jnfp_201404230004.csv abc_jnfq_201404230004.csv abd_jnfn_201404220004.csv abe_jnfn_201404220004.csv i want to... (1 Reply)
Discussion started by: Mohammed_Tabish
1 Replies

9. Shell Programming and Scripting

Find common files between two directories

I have two directories Dir 1 /home/sid/release1 Dir 2 /home/sid/release2 I want to find the common files between the two directories Dir 1 files /home/sid/release1>ls -lrt total 16 -rw-r--r-- 1 sid cool 0 Jun 19 12:53 File123 -rw-r--r-- 1 sid cool 0 Jun 19 12:53... (5 Replies)
Discussion started by: sidnow
5 Replies
X2SYS_REPORT(1gmt)					       Generic Mapping Tools						X2SYS_REPORT(1gmt)

NAME
x2sys_report - Report statistics from crossover data base SYNOPSIS
x2sys_report -Ccolumn -TTAG [ coedbase.txt ] [ -A ] [ -I[list] ] [ -L[corrtable] ] [ -Nnx_min ] [ -Qe|i ] [ -Rwest/east/south/north[r] ] [ -Strack ] [ -V ] DESCRIPTION
x2sys_report will read the input crossover ASCII data base coedbase.txt (or stdin) and report on the statistics of crossovers (n, mean, stdev, rms, weight) for each track. Options are available to let you exclude tracks and limit the output. -C Specify which data column you want to process. Crossovers related to this column name must be present in the crossover data base. -T Specify the x2sys TAG which tracks the attributes of this data type. OPTIONS
No space between the option flag and the associated arguments. coedbase.txt The name of the input ASCII crossover error data base as produced by x2sys_cross. If not given we read standard input instead. -A Eliminate COEs by distributing the COE between the two tracks in proportion to track weight and producing (dist, adjustment) spline knots files for each track (for the selected column). Such adjustments may be used by x2sys_datalist. The adjustment files are called track.column.adj and are placed in the $X2SYS_HOME/TAG directory. For background information on how these adjustments are designed, see Mittal [1984]. -I Name of ASCII file with a list of track names (one per record) that should be excluded from consideration [Default includes all tracks]. -L Apply optimal corrections to the chosen observable. Append the correction table to use [Default uses the correction table TAG_cor- rections.txt which is expected to reside in the $X2SYS_HOME/TAG directory]. For the format of this file, see x2sys_solve. -N Only report data from tracks involved in at least nx_min crossovers [all tracks]. -Q Append e for external crossovers or i for internal crossovers only [Default is external]. -R west, east, south, and north specify the Region of interest, and you may specify them in decimal degrees or in [+-]dd:mm[:ss.xxx][W|E|S|N] format. Append r if lower left and upper right map coordinates are given instead of w/e/s/n. The two shorthands -Rg and -Rd stand for global domain (0/360 and -180/+180 in longitude respectively, with -90/+90 in latitude). Alterna- tively, specify the name of an existing grid file and the -R settings (and grid spacing, if applicable) are copied from the grid. For Cartesian data just give xmin/xmax/ymin/ymax. This option bases the statistics on those COE that fall inside the specified domain. -S Name of a single track. If given we restrict output to those crossovers involving this track [Default output is crossovers involv- ing any track pair]. -V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. EXAMPLES
To report statistics of all the external magnetic crossovers associated with the tag MGD77 from the file COE_data.txt, restricted to occupy a certain region in the south Pacific, try x2sys_report COE_data.txt -V -TMGD77 -R180/240/-60/-30 -Cmag > mag_report.txt To report on the faa crossovers globally that involves track 12345678, try x2sys_report COE_data.txt -V -TMGD77 -Cfaa -S12345678 > faa_report.txt REFERENCES
Mittal, P. K.(1984), Algorithm for error adjustment of potential field data along a survey network, Geophysics, 49(4), 467-469. SEE ALSO
x2sys_binlist(1) x2sys_cross(1) x2sys_datalist(1) x2sys_get(1) x2sys_init(1) x2sys_list(1) x2sys_put(1) x2sys_solve(1) GMT 4.5.7 15 Jul 2011 X2SYS_REPORT(1gmt)
All times are GMT -4. The time now is 02:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy