Sponsored Content
Top Forums Shell Programming and Scripting Compare columns of 2 files based on condition defined in a different file Post 302469586 by newtoawk on Sunday 7th of November 2010 04:51:53 AM
Old 11-07-2010
Thanks a lot Pravin, wish you happy deepavali to you. I ran the script and this is the output I got.
Code:
Y|adbc|Y|Y|Y|
Y|juio|Y|Y|Y|

Can you please explain me the code, so that I can make changes accordingly.
Thanks once again.

Last edited by Scott; 11-07-2010 at 05:57 AM..
 

10 More Discussions You Might Find Interesting

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

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 2 files based on columns

Hi Experts, Is there a way to compare 2 files by columns and print matching cases. I have 2 files as below, I want cases where col1 and col2 in f1 matches col1 and col2 in f2 to be printed as output. The separator is space. I want the output to have col1 col2 col 3 from both files printed... (7 Replies)
Discussion started by: novice_man
7 Replies

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

5. Shell Programming and Scripting

compare 2 files and return unique lines in each file (based on condition)

hi my problem is little complicated one. i have 2 files which appear like this file 1 abbsss:aa:22:34:as akl abc 1234 mkilll:as:ss:23:qs asc abc 0987 mlopii:cd:wq:24:as asd abc 7866 file2 lkoaa:as:24:32:sa alk abc 3245 lkmo:as:34:43:qs qsa abc 0987 kloia:ds:45:56:sa acq abc 7805 i... (5 Replies)
Discussion started by: anurupa777
5 Replies

6. Shell Programming and Scripting

Compare files in a folder based on another file

I have a file named file.txt that looks as follows //class1.txt 45 234 67 89 90 //class2.txt 456 34 78 89 120 class1 and class2.txt are the names of files in a folder named folder1. The content of class1.txt file in folder1 67 9 89 5 234 9The content of class2.txt file in... (1 Reply)
Discussion started by: jaff rufus
1 Replies

7. Shell Programming and Scripting

Extracting rows and columns in a matrix based on condition

Hi I have a matrix with n rows and m columns like below example. i want to extract all the pairs with values <200. Input A B C D A 100 206 51 300 B 206 100 72 48 C 351 22 100 198 D 13 989 150 100 Output format A,A:200 A,C:51 B,B:100... (2 Replies)
Discussion started by: anurupa777
2 Replies

8. Shell Programming and Scripting

Convert rows to columns based on condition

I have a file some thing like this: GN Name=YWHAB; RC TISSUE=Keratinocyte; RC TISSUE=Thymus; CC -!- FUNCTION: Adapter protein implicated in the regulation of a large CC spectrum of both general and specialized signaling pathways GN Name=YWHAE; RC TISSUE=Liver; RC ... (13 Replies)
Discussion started by: raj_k
13 Replies

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

10. Shell Programming and Scripting

I have this list of files . Now I will have to pick the latest file based on some condition

3679 Jul 21 23:59 belk_rpo_error_**po9324892**_07212014.log 0 Jul 22 23:59 belk_rpo_error_**po9324892**_07222014.log 3679 Jul 23 23:59 belk_rpo_error_**po9324892**_07232014.log 22 Jul 22 06:30 belk_rpo_error_**po9324267**_07012014.log 0 Jul 20 05:50... (5 Replies)
Discussion started by: LoneRanger
5 Replies
HAPPY(1)						      Happy Parser Generator							  HAPPY(1)

NAME
happy - the parser generator for Haskell SYNOPSIS
happy [OPTION]... file [OPTION]... DESCRIPTION
This manual page documents briefly the happy command. This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. Instead, it has documentation in various other formats, including DVI, Info and HTML; see below. Happy is a parser generator system for Haskell. `HAPPY' is a dyslexic acronym for `A Yacc-like Haskell Parser generator'. There are two types of grammar files, file.y and file.ly, with the latter observing the reverse comment bird track convention (i.e. each code line must begin with `>'). The examples distributed with Happy are all of the .ly form. Caveat: When using hbc (Chalmers Haskell) the command argument structure is slightly different. This is because the hbc run time system takes some flags as its own (for setting things like the heap size, etc). This problem can be circumvented by adding a single dash (`-') to your command line. So when using a hbc generated version of Happy, the argument structure is: happy - [OPTION]... file [OPTION]... OPTIONS
The programs follow the usual GNU command line syntax, with long options starting with two dashes (`--'). A summary of options is included below. For a complete description, see the other documentation. -h, --help Show summary of options. -v, --version Print version information on standard output then exit successfully. -a, --array Instructs Happy to generate a parser using an array-based shift reduce parser. When used in conjunction with -g, the arrays will be encoded as strings, resulting in faster parsers. Without -g, standard Haskell arrays will be used. -g, --ghc Instructs Happy to generate a parser that uses GHC-specific extensions to obtain faster code. -c, --coerce Use GHC's unsafeCoerce# extension to generate smaller faster parsers. One drawback is that some type safety is lost, which means that a parser generated with -c may compile fine but crash at run-time. Be sure to compile your grammar without -c first to ensure it is type-correct. This option has quite a significant effect on the performance of the resulting parser, but remember that parsers generated this way can only be compiled by GHC 3.02 and above. This option may only be used in conjuction with -g. -d, --debug Generate a parser that will print debugging information to stderr at run-time, including all the shifts, reductions, state transi- tions and token inputs performed by the parser. This option may only be used in conjuction with -a. -i [FILE], --info[=FILE] Directs Happy to produce an info file containing detailed information about the grammar, parser states, parser actions, and con- flicts. Info files are vital during the debugging of grammars. The filename argument is optional, and if omitted the info file will be written to FILE.info (where FILE is the input file name with any extension removed). -o FILE, --outfile=FILE Specifies the destination of the generated parser module. If omitted, the parser will be placed in FILE.hs, where FILE is the name of the input file with any extension removed. If FILE is - the generated parser is sent to the standard output. -m NAME, --magic-name=NAME Happy prefixes all the symbols it uses internally with either happy or Happy. To use a different string, for example if the use of happy is conflicting with one of your own functions, specify the prefix using the -m option. -t DIR, --template=DIR Instructs Happy to use this directory when looking for template files: these files contain the static code that Happy includes in every generated parser. You shouldn't need to use this option if Happy is properly configured for your computer. -l, --glr Instructs Happy to output a GLR parser instead of an LALR(1) parser. -k, --decode Causes the GLR parser to generate code for decoding the parse forest to a list of semantic results (requires --ghc). -f, --filter Causes the GLR parser to filter out nodes which aren't required for the semantic results (an experimental optimisation, requires --ghc). FILES
/usr/share/happy-1.18.9 SEE ALSO
/usr/share/doc/happy, the Happy homepage (http://haskell.org/happy/) <http://haskell.org/happy/> COPYRIGHT
Happy Version 1.18.9 Copyright (c) 1993-1996 Andy Gill, Simon Marlow; (c) 1997-2001 Simon Marlow AUTHOR
This manual page was written by Michael Weber <michaelw@debian.org>, for the Debian GNU/Linux system (but may be used by others). Glasgow FP Suite 2000-12-23 HAPPY(1)
All times are GMT -4. The time now is 02:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy