SHELL SCRIPT
Hi,
I have 3 separate files within a folder. Every File contains data in a single column like
File1 contains data
mayank
sushant
dheeraj
File2 contains
DSA_AT
MG_AT
FLAT_09
File3 contains data
123123
232323 (2 Replies)
I need to write a program to do something like a 'vlookup' in excel. I want to match data from file2 based on two fields (where both match) in file1, and for matching lines, add the data from two of the fields from file2 to file1.
If anyone knows something in perl or awk that can do this, I'd be... (20 Replies)
Hi,
I need help on appending certain field in my file1.txt based on matched patterns in file2.txt using awk or sed.
The blue color need to match with one of the data in field $2 in file2.txt. If match, BEGIN and FINISHED value in red will have a new value from field $3 and $4 accordingly.
... (1 Reply)
Dear List,
I have a file of csv data which has a different line per compliance check per host. I do not want any omissions from this csv data file which looks like this:
date,hostname,status,color,check
02-03-2012,COMP1,FAIL,Yellow,auth_pass_change... (3 Replies)
I need to take 2 input files and create 1 output based on matches from each file. I am looking to match field #1 in both files (Userid) and create an output file that will be a combination of fields from
both file1 and file2 if there are any differences in the fields 2,3,4,5,or 6.
Below is an... (5 Replies)
Hi,
I have a file of csv data, which looks like this:
file1:
1AA,LGV_PONCEY_LES_ATHEE,1,\N,1,00020460E1,0,\N,\N,\N,\N,2,00.22335321,0.00466628
2BB,LES_POUGES_ASF,\N,200,200,00006298G1,0,\N,\N,\N,\N,1,00.30887539,0.00050312... (10 Replies)
Hi, I am newbie in shell script.
I need your help to solve my problem.
Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file.
File1:
SourceFile,DateTimeOriginal
/home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
I'm trying to use awk to count the occurrences of two matching fields of a CSV file.
For instance, for data that looks like this...
Joe,Blue,Yes,No,High
Mike,Blue,Yes,Yes,Low
Joe,Red,No,No,Low
Joe,Red,Yes,Yes,Low
I've been trying to use code like this...
countvar=`awk ' $2~/$color/... (4 Replies)
Trying to use awk to match the contents of each line in file1 with $5 in file2. Both files are tab-delimited and there may be a space or special character in the name being matched in file2, for example in file1 the name is BRCA1 but in file2 the name is BRCA 1 or in file1 name is BCR but in file2... (6 Replies)
I've written an awk script to compare two fields in two different files and then print portions of each file on the same line when matched. It works reasonably well, but every now and again, I notice some errors and cannot seem to figure out what the issue may be and am turning to you for help.
... (2 Replies)
Discussion started by: jvoot
2 Replies
LEARN ABOUT REDHAT
merge
MERGE(1) General Commands Manual MERGE(1)NAME
merge - three-way file merge
SYNOPSIS
merge [ options ] file1 file2 file3
DESCRIPTION
merge incorporates all changes that lead from file2 to file3 into file1. The result ordinarily goes into file1. merge is useful for com-
bining separate changes to an original. Suppose file2 is the original, and both file1 and file3 are modifications of file2. Then merge
combines both changes.
A conflict occurs if both file1 and file3 have changes in a common segment of lines. If a conflict is found, merge normally outputs a
warning and brackets the conflict with <<<<<<< and >>>>>>> lines. A typical conflict will look like this:
<<<<<<< file A
lines in file A
=======
lines in file B
>>>>>>> file B
If there are conflicts, the user should edit the result and delete one of the alternatives.
OPTIONS -A Output conflicts using the -A style of diff3(1), if supported by diff3. This merges all changes leading from file2 to file3 into
file1, and generates the most verbose output.
-E, -e These options specify conflict styles that generate less information than -A. See diff3(1) for details. The default is -E. With
-e, merge does not warn about conflicts.
-L label
This option may be given up to three times, and specifies labels to be used in place of the corresponding file names in conflict
reports. That is, merge -L x -L y -L z a b c generates output that looks like it came from files x, y and z instead of from files
a, b and c.
-p Send results to standard output instead of overwriting file1.
-q Quiet; do not warn about conflicts. -V Print 's version number.
DIAGNOSTICS
Exit status is 0 for no conflicts, 1 for some conflicts, 2 for trouble.
IDENTIFICATION
Author: Walter F. Tichy.
Manual Page Revision: 5.7; Release Date: 1995/06/01.
Copyright (C) 1982, 1988, 1989 Walter F. Tichy.
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert.
SEE ALSO diff3(1), diff(1), rcsmerge(1), co(1).
BUGS
It normally does not make sense to merge binary files as if they were text, but merge tries to do it anyway.
GNU 1995/06/01 MERGE(1)