Sponsored Content
Top Forums Shell Programming and Scripting perl: comparision of field line by line in two files Post 302636505 by Thelost on Monday 7th of May 2012 03:11:14 PM
Old 05-07-2012
Thank you again,
I have to extract the lines in file 2, whose coordinates are between Start and End positions of the file 1, which also belong to the same strain. In other words two assumptions must be fulfilled going line by line and check if the strain matches and if the coordinate is within the range formed by Start and End, then the expected output is the line of file 2.
for example
Code:
Int <T> 5083_6_1 358909> A <3_6_1 358909> A <

I know that there are lines that fulfilled this assumptions, I checked it by hand and found several lines.

---------- Post updated at 09:11 PM ---------- Previous update was at 07:39 PM ----------

Really I don't know what happens but the expected output is not that
is...
Coordinate type RefAllele Strain SNPAllele
240450 non <G> 6949_5_23 >A<

Sorry

Last edited by Scrutinizer; 05-07-2012 at 03:36 PM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

file comparision by line

i have two files and i want to compare these two it shoud print those lines which are not in 2nd file a.txt 1236,AB,0 2345,CD,1 5679,EF,1 9123,AA,1 9223,AA,0 b.txt 1234,AB,0 2345,CD,1 5678,EF,1 9123,AA,0 o/p 1236,AB,0 5679,EF,1 9123,AA,1 9223,AA,0 (6 Replies)
Discussion started by: aaysa123
6 Replies

2. Shell Programming and Scripting

Line by Line Comparision of 2 files and print only the difference

Hi, I am trying to find an alternative way to do tkdiff. In tkdiff the gui compares each line and highlights only the differences. for eg: John works at McDonalds s(test) He was playing guitar tywejk John works in McDonalds 9908 He was playing guitar I am... (1 Reply)
Discussion started by: naveen@
1 Replies

3. Shell Programming and Scripting

how to read the contents of two files line by line and compare the line by line?

Hi All, I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
Discussion started by: mjavalkar
4 Replies

4. Shell Programming and Scripting

Two files comparision with single field

Hi , Im new to uxin environment and shell scripting.... please help me with the code for the following scenario..... file 1 contains the following fields abc 200 rupee IND cdf 400 dollar USA efg 300 euro GER hij 600 pound ENG file 2 SBI abc 321 dollar CANAD kvr mnd ... (6 Replies)
Discussion started by: shivaji_veer
6 Replies

5. Shell Programming and Scripting

File comparision line by line

Hi, I want to compare 2 files and get output file into seperate folder. Both file names will change daily with timestamp (ex: file1_06_17_2013_0514), so i can't mention the file names in the script to compare, but i need to compare these 2 files daily and generate output to another... (28 Replies)
Discussion started by: rkrish123
28 Replies

6. Shell Programming and Scripting

Perl how to compare two pdf files line by line

Hi Experts, Would really appreciate if anyone can guide me how to compare two pdf files line by line and report the difference to another file. (3 Replies)
Discussion started by: prasanth_babu
3 Replies

7. Shell Programming and Scripting

Replace first field of a line with previous filed of the line

Hi Everyone, I have a file as below: IM2345638,sherfvf,usha,30 IM384940374,deiufbd,usha,30 IM323763822,cdejdkdnbds,theju,15 0,dhejdncbfd,us,20 IM398202038,dhekjdkdld,tj,30 0,foifsjd,u2,40 The output i need is as below IM2345638,sherfvf,usha,30... (4 Replies)
Discussion started by: usha rao
4 Replies

8. Shell Programming and Scripting

Add specific string to last field of each line in perl based on value

I am trying to add a condition to the below perl that will capture the GTtag and place a specific string in the last field of each line. The problem is that the GT value used is not right after the tag rather it is a few fields away. The values should always be 0/1 or 1/2 and are in bold in the... (12 Replies)
Discussion started by: cmccabe
12 Replies

9. Shell Programming and Scripting

Perl command line option '-n','-p' and multiple files: can it know a file name of a printed line?

I am looking for help in processing of those options: '-n' or '-p' I understand what they do and how to use them. But, I would like to use them with more than one file (and without any shell-loop; loading the 'perl' once.) I did try it and -n works on 2 files. Question is: - is it possible to... (6 Replies)
Discussion started by: alex_5161
6 Replies

10. Shell Programming and Scripting

Printing string from last field of the nth line of file to start (or end) of each line (awk I think)

My file (the output of an experiment) starts off looking like this, _____________________________________________________________ Subjects incorporated to date: 001 Data file started on machine PKSHS260-05CP ********************************************************************** Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies
GROFF_ME(7)						 Miscellaneous Information Manual					       GROFF_ME(7)

NAME
groff_me - troff macros for formatting papers SYNOPSIS
groff -me [ options ] file ... groff -m me [ options ] file ... DESCRIPTION
This manual page describes the GNU version of the -me macros, which is part of the groff document formatting system. This version can be used with both GNU troff and Unix troff. This package of troff macro definitions provides a canned formatting facility for technical papers in various formats. The macro requests are defined below. Many troff requests are unsafe in conjunction with this package, however, these requests may be used with impunity after the first .pp: .bp begin new page .br break output line here .sp n insert n spacing lines .ls n (line spacing) n=1 single, n=2 double space .na no alignment of right margin .ce n center next n lines .ul n underline next n lines Output of the pic, eqn, refer, and tbl preprocessors is acceptable as input. FILES
/usr/share/groff/1.19.2/tmac/me.tmac (a wrapper file for e.tmac) /usr/share/groff/1.19.2/tmac/e.tmac SEE ALSO
groff(1), troff(1) -me Reference Manual, Eric P. Allman Writing Papers with Groff Using -me REQUESTS
This list is incomplete; see The -me Reference Manual for interesting details. Request Initial Cause Explanation Value Break .(c - yes Begin centered block .(d - no Begin delayed text .(f - no Begin footnote .(l - yes Begin list .(q - yes Begin major quote .(x x - no Begin indexed item in index x .(z - no Begin floating keep .)c - yes End centered block .)d - yes End delayed text .)f - yes End footnote .)l - yes End list .)q - yes End major quote .)x - yes End index item .)z - yes End floating keep .++ m H - no Define paper section. m defines the part of the paper, and can be C (chapter), A (appendix), P (preliminary, e.g., abstract, table of contents, etc.), B (bibliography), RC (chapters renumbered from page one each chapter), or RA (ap- pendix renumbered from page one). .+c T - yes Begin chapter (or appendix, etc., as set by .++). T is the chapter title. .1c 1 yes One column format on a new page. .2c 1 yes Two column format. .EN - yes Space after equation produced by eqn or neqn. .EQ x y - yes Precede equation; break out and add space. Equation number is y. The optional argument x may be I to indent equation (default), L to left-adjust the equation, or C to center the equation. .GE - yes End gremlin picture. .GS - yes Begin gremlin picture. .PE - yes End pic picture. .PS - yes Begin pic picture. .TE - yes End table. .TH - yes End heading section of table. .TS x - yes Begin table; if x is H table has repeated heading. .b x no no Print x in boldface; if no argument switch to boldface. .ba +n 0 yes Augments the base indent by n. This indent is used to set the indent on regular text (like paragraphs). .bc no yes Begin new column .bi x no no Print x in bold italics (nofill only) .bu - yes Begin bulleted paragraph .bx x no no Print x in a box (nofill only). .ef 'x'y'z' '''' no Set even footer to x y z .eh 'x'y'z' '''' no Set even header to x y z .fo 'x'y'z' '''' no Set footer to x y z .hx - no Suppress headers and footers on next page. .he 'x'y'z' '''' no Set header to x y z .hl - yes Draw a horizontal line .i x no no Italicize x; if x missing, italic text follows. .ip x y no yes Start indented paragraph, with hanging tag x. Indentation is y ens (default 5). .lp yes yes Start left-blocked paragraph. .np 1 yes Start numbered paragraph. .of 'x'y'z' '''' no Set odd footer to x y z .oh 'x'y'z' '''' no Set odd header to x y z .pd - yes Print delayed text. .pp no yes Begin paragraph. First line indented. .r yes no Roman text follows. .re - no Reset tabs to default values. .sh n x - yes Section head follows, font automatically bold. n is level of section, x is title of section. .sk no no Leave the next page blank. Only one page is remembered ahead. .sm x - no Set x in a smaller pointsize. .sz +n 10p no Augment the point size by n points. .tp no yes Begin title page. .u x - no Underline argument (even in troff). (Nofill only). .uh - yes Like .sh but unnumbered. .xp x - no Print index x. 3rd Berkeley Distribution 27 June 2001 GROFF_ME(7)
All times are GMT -4. The time now is 11:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy