Sponsored Content
Top Forums Shell Programming and Scripting Compare columns of multiple files and print those unique string from File1 in an output file. Post 302863831 by Subbeh on Tuesday 15th of October 2013 07:26:28 AM
Old 10-15-2013
How about this:
Code:
comm -23 <(sort file1) <(sort file2 file3 file4)

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

compare columns from seven files and print the output

Hi guys, I need some help to come out with a solution . I have seven such files but I am showing only three for convenience. filea a5 20 a8 16 fileb a3 42 a7 14 filec a5 23 a3 07 The output file shoud contain the data in table form showing first field of... (7 Replies)
Discussion started by: smriti_shridhar
7 Replies

2. Shell Programming and Scripting

Compare multiple fields in file1 to file2 and print line and next line

Hello, I have two files that I need to compare and print out the line from file2 that has the first 6 fields matching the first 6 fields in file1. Complicating this are the following restrictions 1. file1 is only a few thousand lines at most and file2 is greater than 2 million 2. I need to... (7 Replies)
Discussion started by: gillesc_mac
7 Replies

3. Shell Programming and Scripting

compare two columns of different files and print the matching second file..

Hi, I have two tab separated files; file1: S.No ddi fi cu o/l t+ t- 1 0.5 0.6 o 0.1 0.2 2 0.2 0.3 l 0.3 0.4 3 0.5 0.8 l 0.1 0.6 ... (5 Replies)
Discussion started by: vasanth.vadalur
5 Replies

4. Programming

Compare two files of 4 columns and o/p unique,append zero's

I have to files File1 1 23 2 34 3 7 4 56 5 61 6 22 7 65 File2 2 21 4 32 7 22 Now i need to compare column1 of both the files and generate a third file which should contain all the values of 1st column of 1st file and in the second column i need to get the coressponding row... (2 Replies)
Discussion started by: kamuju
2 Replies

5. Shell Programming and Scripting

awk compare specific columns from 2 files, print new file

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)
Discussion started by: jm4smtddd
1 Replies

6. Shell Programming and Scripting

Compare multiple files and print unique lines

Hi friends, I have multiple files. For now, let's say I have two of the following style cat 1.txt cat 2.txt output.txt Please note that my files are not sorted and in the output file I need another extra column that says the file from which it is coming. I have more than 100... (19 Replies)
Discussion started by: jacobs.smith
19 Replies

7. Shell Programming and Scripting

Compare multiple files, identify common records and combine unique values into one file

Good morning all, I have a problem that is one step beyond a standard awk compare. I would like to compare three files which have several thousand records against a fourth file. All of them have a value in each row that is identical, and one value in each of those rows which may be duplicated... (1 Reply)
Discussion started by: nashton
1 Replies

8. Shell Programming and Scripting

[Solved] awk compare two different columns of two files and print all from both file

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)
Discussion started by: justinjj
2 Replies

9. UNIX for Dummies Questions & Answers

Compare file1 and file2, print matching lines in same order as file1

I want to print only the lines in file2 that match file1, in the same order as they appear in file 1 file1 file2 desired output: I'm getting the lines to match awk 'FNR==NR {a++}; FNR!=NR && a' file1 file2 but they are in sorted order, which is not what I want: Can anyone... (4 Replies)
Discussion started by: pathunkathunk
4 Replies

10. UNIX for Beginners Questions & Answers

Split into multiple files by using Unique columns in a UNIX file

I have requirement to split below file (sample.csv) into multiple files by using the unique columns (first 3 are unique columns) sample.csv 123|22|56789|ABCDEF|12AB34|2019-07-10|2019-07-10|443.3400|1|1 123|12|5679|BCDEFG|34CD56|2019-07-10|2019-07-10|896.7200|1|2... (3 Replies)
Discussion started by: RVSP
3 Replies
gfs_tool(8)						      System Manager's Manual						       gfs_tool(8)

NAME
gfs_tool - interface to gfs ioctl calls SYNOPSIS
gfs_tool COMMAND [OPTION] [PARAMETERS ...] DESCRIPTION
gfs_tool is an interface to a variety of the GFS ioctl calls. Specifying gfs_tool -h prints gfs_tool command line usage (help). Specifying gfs_tool -V prints the gfs_tool version information. COMMANDS
clearflag Flag File1 File2 ... Clear an attribute flag on a file. counters MountPoint [-c] [-i interval] Print out statistics about a filesystem. If -c is specified, gfs_tool keeps running printing out the statistics once per second or, if specified, the interval given with the -i option, in seconds. df MountPoint [-k]|[-H] Print out a space usage summary of a given filesystem. The information printed is more detailed than a standard "df". If -k is specified, the output is given in kilobytes (KB). If -H is specified, the output is given in human readable format (similar to df -h). If neither -k nor -H are specified, the output is given in file system blocks. freeze MountPoint Freeze (quiesce) a GFS cluster. getsb MountPoint Print out the superblock of a mounted filesystem. gettune MountPoint Print out the current values of the tuning parameters in a running filesystem. jindex MountPoint Print out the journal index of a mounted filesystem. layout File [buffersize] Print out on-disk layout information about a file or directory. Buffersize is the size of the buffer (in bytes) that gfs_tool allo- cates to store the file's metadata during processing. It defaults to 4194304 bytes. If you are printing a very big directory you may need to specify a bigger size. list List the currently mounted GFS filesystems. Each line represents a filesystem. The columns represent (in order): 1) A number that is a cookie that represents the mounted filesystem. 2) The name of the device that holds the filesystem (well, the name as the Linux kernel knows it). 3) The lock table field that the filesystem was mounted with. lockdump MountPoint [buffersize] Print out information about the locks this machine holds for a given filesystem. Buffersize is the size of the buffer (in bytes) that gfs_tool allocates to store the lock data during processing. It defaults to 4194304 bytes. margs arguments This loads arguments into the module what will override the mount options passed with the -o field on the next mount. See mount.gfs(8). reclaim File Returns unused on-disk metadata blocks to free blocks. rindex MountPoint Print out the resource group index of a mounted filesystem. quota MountPoint Print out the quota file of a mounted filesystem. Also see the "gfs_quota list" command. sb device proto [newvalue] View (and possibly replace) the name of the locking protocol in the file system superblock. The file system shouldn't be mounted by any client when you do this. sb device table [newvalue] View (and possibly replace) the name of the locking table in the file system superblock. The file system shouldn't be mounted by any client when you do this. sb device ondisk [newvalue] View (and possibly replace) the ondisk format number in the file system superblock. The file system shouldn't be mounted by any client when you do this. No one should have to use this. sb device multihost [newvalue] View (and possibly replace) the multihost format number in the file system superblock. The file system shouldn't be mounted by any client when you do this. No one should have to use this. sb device all Print out the superblock. setflag Flag File1 File2 ... Set an attribute flag on a file. There are four currently supported flags. They are jdata, directio, inherit_jdata, and inherit_directio. The jdata flag causes all the data written to a regular file to be journaled. The jdata flag can only be set (or cleared) if the file is zero length. The directio flag causes all I/O to a regular file to be Direct I/O, even if the O_DIRECT flag isn't used on the open() command. The inherit_jdata flag is set on a directory. It causes all new regular files created in that directory automatically inherit the jdata flag. The inherit_jdata is also inherited by any new subdirectories created in that directory. The inherit_directio flag is set on a directory. It causes all new regular files created in that directory automatically inherit the directio flag. The inherit_directio is also inherited by any new subdirectories created in that directory. settune MountPoint parameter newvalue Set the value of tuning parameter. Use gettune for a listing of tunable parameters. shrink MountPoint Causes any unused inodes to be thrown out of memory. stat File Print out extended stat information about a file. unfreeze MountPoint Unfreeze a GFS cluster. version Print out the version of GFS that this program goes with. withdraw MountPoint Cause GFS to abnormally shutdown a given filesystem on this node. gfs_tool(8)
All times are GMT -4. The time now is 04:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy