Sponsored Content
Top Forums Shell Programming and Scripting perl: comparision of field line by line in two files Post 302636499 by Klashxx on Monday 7th of May 2012 01:21:17 PM
Old 05-07-2012
No worry , give us an example of your expected output.
 

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
PCOMB(1)						      General Commands Manual							  PCOMB(1)

NAME
pcomb - combine RADIANCE pictures SYNOPSIS
pcomb [ -h ][ -w ][ -x xres ][ -y yres ][ -f file ][ -e expr ] [ [ -o ][ -s factor ][ -c r g b ] input .. ] DESCRIPTION
Pcomb combines equal-sized RADIANCE pictures and sends the result to the standard output. By default, the result is just a linear combina- tion of the input pictures multiplied by -s and -c coefficients, but an arbitrary mapping can be assigned with the -e and -f options. Neg- ative coefficients and functions are allowed, and pcomb will produce color values of zero where they would be negative. The variables ro, go and bo specify the red, green and blue output values, respectively. Alternatively, the single variable lo can be used to specify a brightness value for black and white output. The predefined functions ri(n), gi(n) and bi(n) give the red, green and blue input values for picture n. To access a pixel that is nearby the current one, these functions also accept optional x and y offsets. For example, ri(3,-2,1) would return the red component of the pixel from picture 3 that is left 2 and up 1 from the current position. Although x offsets may be as large as width of the picture, y offsets are limited to a small window (+/- 32 pixels) due to efficiency considera- tions. However, it is not usually necessary to worry about this problem -- if the requested offset is not available, the next best pixel is returned instead. For additional convenience, the function li(n) is defined as the input brightness for picture n. This function also accepts x and y off- sets. The constant nfiles gives the number of input files present, and WE gives the white efficacy (lumens/brightness) for pixel values, which may be used with the -o option or the le(n) values to convert to absolute photometric units (see below). The variables x and y give the current output pixel location for use in spatially dependent functions, the constants xmax and ymax give the input resolution, and the con- stants xres and yres give the output resolution (usually the same, but see below). The constant functions re(n), ge(n), be(n), and le(n) give the exposure values for picture n, and pa(n) gives the corresponding pixel aspect ratio. Finally, for pictures with stored view parameters, the functions Ox(n), Oy(n) and Oz(n) return the ray origin in world coordinates for the current pixel in picture n, and Dx(n), Dy(n) and Dz(n) return the normalized ray direction. In addition, the function T(n) returns the distance from the origin to the aft clip- ping plane (or zero if there is no aft plane), and the function S(n) returns the solid angle of the current pixel in steradians (always zero for parallel views). If the current pixel is outside the view region, T(n) will return a negative value, and S(n) will return zero. The -h option may be used to reduce the information header size, which can grow disproportionately after multiple runs of pcomb and/or pcompos(1). The -w option can be used to suppress warning messages about invalid calculations. The -o option indicates that original pixel values are to be used for the next picture, undoing any previous exposure changes or color correction. The -x and -y options can be used to specify the desired output resolution, xres and yres, and can be expressions involving other constants such as xmax and ymax. The constants xres and yres may also be specified in a file or expression. The default output resolution is the same as the input resolution. The -x and -y options must be present if there are no input files, when the definitions of ro, go and bo will be used to compute each out- put pixel. This is useful for producing simple test pictures for various purposes. (Theoretically, one could write a complete renderer using just the functional language...) The standard input can be specified with a hyphen ('-'). A command that produces a RADIANCE picture can be given in place of a file by preceeding it with an exclamation point ('!'). EXAMPLES
To produce a picture showing the difference between pic1 and pic2: pcomb -e 'ro=ri(1)-ri(2);go=gi(1)-gi(2);bo=bi(1)-bi(2)' pic1 pic2 > diff Or, more efficiently: pcomb pic1 -s -1 pic2 > diff To precompute the gamma correction for a picture: pcomb -e 'ro=ri(1)^.4;go=gi(1)^.4;bo=bi(1)^.4' inp.hdr > gam.hdr To perform some special filtering: pcomb -f myfilt.cal -x xmax/2 -y ymax/2 input.hdr > filtered.hdr To make a picture of a dot: pcomb -x 100 -y 100 -e 'ro=b;go=b;bo=b;b=if((x-50)^2+(y-50)^2-25^2,0,1)' > dot AUTHOR
Greg Ward SEE ALSO
getinfo(1), icalc(1), pcompos(1), pfilt(1), rpict(1) RADIANCE
8/31/96 PCOMB(1)
All times are GMT -4. The time now is 05:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy