Sponsored Content
Top Forums Shell Programming and Scripting Compare two files Field by field and output the result in another file Post 302674607 by i150371485 on Friday 20th of July 2012 06:22:10 AM
Old 07-20-2012
@ygor : Thanks for the quick response. I got the answer but i am getting one count extra than the exact output .

Expected Output :

4th line 2nd field
4th line 8th field

Actual Output :

4th line 3nd field
4th line 9th field

Please help in this .. I tried but i am not getting the exact out.

Thanks in advance.

Note : we have "|" at the beginning of every line.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK to compare two files for each field value

I have "n" files in directory A and "n" files in directory B. The files are expected to be the same with same data. Each file has 14 columns and "x" rows. Of the 14 column, 2 columns are to be considered as key identifiers. Based on this unique combination, I need to compare each field value... (2 Replies)
Discussion started by: Sangtha
2 Replies

2. Shell Programming and Scripting

AWK: Pattern match between 2 files, then compare a field in file1 as > or < field in file2

First, thanks for the help in previous posts... couldn't have gotten where I am now without it! So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following: If $1... (4 Replies)
Discussion started by: right_coaster
4 Replies

3. Shell Programming and Scripting

Compare two files and output difference, by first field using awk.

It seems like a common task, but I haven't been able to find the solution. vitallog.txt 1310,John,Hancock 13211,Steven,Mills 122,Jane,Doe 138,Thoms,Doe 1500,Micheal,May vitalinfo.txt 12122,Jane,Thomas 122,Janes,Does 123,Paul,Kite **OUTPUT** vitalfiltered.txt 12122,Jane,Thomas... (2 Replies)
Discussion started by: charles33
2 Replies

4. UNIX for Dummies Questions & Answers

compare two files based on common field in unix

I have two files in UNIX. 1st file is Entity and Second File is References. 1st File has only one column named Entity ID and 2nd file has two columns Entity ID | Person ID. I want to produce a output file where entity id's are matching in both the files. Entity File 624197 624252 624264... (4 Replies)
Discussion started by: PRS
4 Replies

5. Shell Programming and Scripting

Compare Field in Current Line with Field in Previous

Hi Guys I have the following file Essentially, I am trying to find the right awk/sed syntax in order to produce the following 3 distinct files from the file above: Basically, I want to print the lines of the file as long as the second field of the current line is equal to the... (9 Replies)
Discussion started by: moutaye
9 Replies

6. Shell Programming and Scripting

Compare a common field in two files and append a column from File 1 in File2

Hi Friends, I am new to Shell Scripting and need your help in the below situation. - I have two files (File 1 and File 2) and the contents of the files are mentioned below. - "Application handle" is the common field in both the files. (NOTE :- PLEASE REFER TO THE ATTACHMENT "Compare files... (2 Replies)
Discussion started by: Santoshbn
2 Replies

7. Shell Programming and Scripting

Plz Help. Compare 2 files field by field and get the output in another file.

Hi Freinds, I have 2 files . one is source.txt and second one is target.txt. I want to keep source.txt as baseline and compare target.txt. please find the data in 2 files and Expected output. Source.txt 1|HYD|NAG|TRA|34.5|1234 2|CHE|ESW|DES|36.5|134 3|BAN|MEH|TRA|33.5|234... (5 Replies)
Discussion started by: i150371485
5 Replies

8. Shell Programming and Scripting

Compare two CSV files and put the difference in third file with line no,field no and diff value.

I am having two csv files i need to compare these files and the output file should have the information of the differences at the field level. For Example, File 1: A,B,C,D,E,F 1,2,3,4,5,6 File 2: A,C,B,D,E,F 1,2,4,5,5,6 out put file: (12 Replies)
Discussion started by: karingulanagara
12 Replies

9. Shell Programming and Scripting

Use bash command on awk field and output the result

Hello, I want to run a field from an awk command through a command in bash. For example my input file is 1,2,3 20,30,40 60,70,80 I want tot run $2 thought the command date +%d/%m/%y -d"01/01/15 + $2 days -1 day" and get the output 1,02/01/15,3 20,30/01/15,40 60,11/03/15,80 ... (2 Replies)
Discussion started by: garethsays
2 Replies

10. UNIX for Dummies Questions & Answers

Combine Similar Output from the 2nd field w.r.t 1st Field

Hi, For example: I have: HostA,XYZ HostB,XYZ HostC,ABC I would like the output to be: HostA,HostB: XYZ HostC:ABC How can I achieve this? So far what I though of is: (1 Reply)
Discussion started by: alvinoo
1 Replies
BEASTIE.4TH(8)						    BSD System Manager's Manual 					    BEASTIE.4TH(8)

NAME
beastie.4th -- FreeBSD ASCII art boot module DESCRIPTION
The file that goes by the name of beastie.4th is a set of commands designed to draw the ASCII art FreeBSD mascot -- known simply as beastie -- to the right of the boot loader menu. The commands of beastie.4th by themselves are not enough for most uses. Please refer to the exam- ples below for the most common situations, and to loader(8) for additional commands. Before using any of the commands provided in beastie.4th, it must be included through the command: include beastie.4th This line is present in the default /boot/loader.rc file, so it is not needed (and should not be re-issued) in a normal setup. The commands provided by it are: draw-beastie Draws the FreeBSD logo. The logo that is drawn is configured by setting the loader_logo variable in loader.conf(5) to one of ``beastie'', ``beastiebw'', ``fbsdbw'', ``orb'', and ``orbbw'' (the default). The position of the logo can be configured by setting the loader_logo_x and loader_logo_y variables in loader.conf(5). The default values are 46 (x) and 4 (y). clear-beastie Clears the screen of beastie. beastie-start Initializes the interactive boot loader menu. The loader_delay variable can be configured in loader.conf(5) to the number of seconds you would like to delay loading the boot menu. During the delay the user can press Ctrl-C to fall back to autoboot or ENTER to proceed. The default behavior is to not delay. The environment variables that effect its behavior are: loader_logo Selects the desired logo in the beastie boot menu. Possible values are: ``fbsdbw'', ``beastie'', ``beastiebw'', ``orb'', ``orbbw'' (default), and ``none''. loader_logo_x Sets the desired column position of the logo. Default is 46. loader_logo_y Sets the desired row position of the logo. Default is 4. beastie_disable If set to ``YES'', the beastie boot menu will be skipped. The beastie boot menu is always skipped if booting UEFI or running non-x86 hardware. loader_delay If set to a number higher than zero, introduces a delay before starting the beastie boot menu. During the delay the user can press either Ctrl-C to skip the menu or ENTER to proceed to the menu. The default is to not delay when loading the menu. FILES
/boot/loader The loader(8). /boot/beastie.4th beastie.4th itself. /boot/loader.rc loader(8) bootstrapping script. EXAMPLES
Standard i386 /boot/loader.rc: include /boot/beastie.4th beastie-start Set a different logo in loader.conf(5): loader_logo="beastie" SEE ALSO
loader.conf(5), loader(8), loader.4th(8) HISTORY
The beastie.4th set of commands first appeared in FreeBSD 5.1. AUTHORS
The beastie.4th set of commands was written by Scott Long <scottl@FreeBSD.org>, Aleksander Fafula <alex@fafula.com> and Devin Teske <dteske@FreeBSD.org>. BSD
April 27, 2014 BSD
All times are GMT -4. The time now is 10:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy