Sponsored Content
Top Forums Shell Programming and Scripting compare 2 files and return unique lines in each file (based on condition) Post 302691699 by RudiC on Saturday 25th of August 2012 10:19:20 AM
Old 08-25-2012
Are the input files sorted on col 4, or can they be?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Comparing 2 files and return the unique lines in first file

Hi, I have 2 files file1 ******** 01-05-09|java.xls| 02-05-08|c.txt| 08-01-09|perl.txt| 01-01-09|oracle.txt| ******** file2 ******** 01-02-09|windows.xls| 02-05-08|c.txt| 01-05-09|java.xls| 08-02-09|perl.txt| 01-01-09|oracle.txt| ******** (8 Replies)
Discussion started by: shekhar_v4
8 Replies

2. Shell Programming and Scripting

How to compare 2 files & get only few columns based on a condition related to both files?

Hiiiii friends I have 2 files which contains huge data & few lines of it are as shown below File1: b.dat(which has 21 columns) SSR 1976 8 12 13 10 44.00 39.0700 70.7800 7.0 0 0.00 0 2.78 0.00 0.00 0 0.00 2.78 0 NULL ISC 1976 8 12 22 32 37.39 36.2942 70.7338... (6 Replies)
Discussion started by: reva
6 Replies

3. Shell Programming and Scripting

Compare columns of 2 files based on condition defined in a different file

I have a control file which tells me which are the fields in the files I need to compare and based on the values I need to print the exact value if key =Y and output is Y , or if output is Y/N then I need to print only Y if it matches or N if it does not match and if output =N , then skip the feild... (7 Replies)
Discussion started by: newtoawk
7 Replies

4. 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

5. Shell Programming and Scripting

compare 2 files and extract the data which is not present in other file with condition

I have 2 files whose data's are as follows : fileA 00 lieferungen 00 attractiop 01 done 02 forness 03 rasp 04 alwaysisng 04 funny 05 done1 fileB alwayssng dkhf fdgdfg dfgdg sdjkgkdfjg funny rasp (7 Replies)
Discussion started by: rajniman
7 Replies

6. Shell Programming and Scripting

extracting lines based on condition and copy to another file

hi i have an input file that contains some thing like this aaa acc aa abc1 1232 aaa abc2.... poo awq aa abc1 aaa aaa abc2 bbb bcc bb abc1 3214 bbb abc3.... bab bbc bz abc1 3214 bbb abc3.... vvv ssa as abc1 o09 aaa abc4.... azx aaq aa abc1 900 aqq abc19.... aaa aa aaaa abc1 899 aa... (8 Replies)
Discussion started by: anurupa777
8 Replies

7. Shell Programming and Scripting

Deleting lines based on a condition for a group of files

hi i have a set of similar files. i want to delete lines until certain pattern appears in those files. for a single file the following command can be used but i want to do it for all the files at a time since the number is in thousands. awk '/PATTERN/{i++}i' file (6 Replies)
Discussion started by: anurupa777
6 Replies

8. 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

9. Shell Programming and Scripting

Compare columns of multiple files and print those unique string from File1 in an output file.

Hi, I have multiple files that each contain one column of strings: File1: 123abc 456def 789ghi File2: 123abc 456def 891jkl File3: 234mno 123abc 456def In total I have 25 of these type of file. (5 Replies)
Discussion started by: owwow14
5 Replies

10. Shell Programming and Scripting

Delete lines from file based on condition

I want to keep last 2 days data from a file and want to delete others data from the file. Please help me. Sample Input # cat messages-2 Apr 15 11:25:03 test1 kernel: imklog 4.6.2, log source = /proc/kmsg started. Apr 15 11:25:03 test1 rsyslogd: (re)start Apr 16 19:42:03 test1 kernel:... (2 Replies)
Discussion started by: makauser
2 Replies
col(1)							      General Commands Manual							    col(1)

Name
       col - filter reverse line feeds

Syntax
       col [-options]

Description
       The command reads the standard input and writes the standard output.  It performs the line overlays implied by reverse line feeds (ESC-7 in
       ASCII) and by forward and reverse half line feeds (ESC-9 and ESC-8, respectively).  The command is particularly useful for filtering multi-
       column output made with the command of and for filtering output resulting from the preprocessor.

       Although  accepts half line motions in its input, it does not normally output them.  Instead, text that would appear between lines is moved
       to the next lower full line boundary.

       The control characters SO (ASCII code 017) and SI (ASCII code 016) are assumed to start and end text in an alternate  character	set.   The
       character  set (primary or alternate) associated with each printing character read is remembered.  On output, SO and SI characters are gen-
       erated where necessary to maintain the correct treatment of each character.

       The command normally converts white space to tabs to shorten printing time.  If the -h option is given, this conversion is suppressed.

       On input, the only control characters accepted are <space>, <backspace>, <tab>, <return>, <newline>, etc...  The VT character is an  alter-
       nate  form  of  full reverse linefeed, included for compatibility with earlier programs of this type. All other non-printing characters are
       ignored.

Options
       -b     Assumes that the output device does not have backspacing.

       -f     Suppresses moving half lines to the next full line.

       -h     Suppresses conversion of white space to tabs.

       -p     Forces through unchanged any unknown escape sequences that are found in its input. This option should be used with care.

       -x     Suppresses conversion of white space to tabs (same as -h).

Restrictions
       Cannot back up more than 128 lines.
       No more than 800 characters, including backspaces, on a line.

See Also
       tbl(1), nroff(1)

																	    col(1)
All times are GMT -4. The time now is 07:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy