Sponsored Content
Top Forums Shell Programming and Scripting Matching two fields in two csv files, create new file and append match Post 303023723 by RudiC on Friday 21st of September 2018 08:58:42 AM
Old 09-21-2018
Don't double post. What's new compared to your other thread https://www.unix.com/shell-programming-and-scripting/279906-comparing-two-columns-two-files-printing-third-based-match.html except the two (new?) input files? Your (new?) desired output doesn't seem to satisfy your specification, does it?


EDIT: adding
Code:
{gsub (/[ 	]*,[ 	]*/, ",")}

(note the <TAB> chars!) as the first statement in your awk script might help accomplish your task.

Last edited by RudiC; 09-21-2018 at 10:07 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to create a CSV File by reading fields from separate files

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)
Discussion started by: mayanksargoch
2 Replies

2. Shell Programming and Scripting

Match data based on two fields, and append to a line

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)
Discussion started by: jamessmith01
20 Replies

3. UNIX for Dummies Questions & Answers

Match values from 2 files and append certain fields

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)
Discussion started by: redse171
1 Replies

4. Shell Programming and Scripting

Matching and Merging csv data fields based on a common field

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)
Discussion started by: landossa
3 Replies

5. Shell Programming and Scripting

awk help: Match data fields from 2 files & output results from both into 1 file

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)
Discussion started by: ambroze
5 Replies

6. Shell Programming and Scripting

Match columns from two csv files and update field in one of the csv file

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)
Discussion started by: djoseph
10 Replies

7. Shell Programming and Scripting

Compare 2 files of csv file and match column data and create a new csv file of them

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)
Discussion started by: refrain
8 Replies

8. UNIX for Beginners Questions & Answers

How to count lines of CSV file where 2 fields match variables?

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)
Discussion started by: nmoore2843
4 Replies

9. Shell Programming and Scripting

awk to print fields that match using conditions and a default value for non-matching in two files

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)
Discussion started by: cmccabe
6 Replies

10. UNIX for Beginners Questions & Answers

Match Fields between two files, print portions of each file together when matched in ([g]awk)'

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

NAME
sfddiff - compare two font files SYNOPSIS
sfddiff [--help] [--ignorehints] [--ignorenames] [--ignoregpos] [--ignoregsub] [--ignorebitmaps] [--exact] [--warn] [--merge outfile] [--usage] [--version] fontfile1 fontfile2 DESCRIPTION
The program sfddiff compares two font files, which may be in any format fontforge(1) can read. It will notice the following differences: 1) Characters are present in one font but not in the other. 2) Characters are present in both fonts but have different sets of outlines or references. The outlines may be compared so that only exact matches are accepted, or so that a fuzzier match is used. Similarly references may need to match exactly, or may be matched after an unlink. This fuzzy comparison is useful when comparing truetype and postscript fonts, or when comparing a font with references to one with- out. 3) The postscript hints or truetype instructions are different. 4) The font names (the truetype `name' table) differ. 5) The kerning (and other `gpos' information) differs. 6) The ligatures (and other `gsub' information) differ. 7) Any bitmap strikes present in one font but not in the other. 8) Any bitmap characters present in one strike of one font but in the equivalent strike of the other. 9) Any bitmap characters which differ. OPTIONS
--help Provide a description with a list of the available options. --ignorehints Suppress the reporting of hint/instruction differences. --ignoregpos Suppress the reporting of kerning (and other `gpos') differences. --ignoregsub Suppress the reporting of ligature (and other `gsub') differences. --ignorenames Suppress the reporting of name string differences. --ignorebitmaps Suppress the reporting of bitmap differences. --exact Require outlines to match exactly. --warn Warn if the outlines/references are slightly different. --merge outfile Store a merged version of the two fonts into the specified output file. The merged data will be based on sfdfile1, as well as any characters present in sfdfile2 but not in sfdfile1 will be added, and the outlines of sfdfile2 will be placed in the background. Finally, for any characters with different outlines or references the background of the the character will contain the outlines from sfdfile2 (references will be unlinked into outlines and those outlines also will be added). --usage Display the usage description. --version Display the current version. SEE ALSO
fontforge(1) The HTML version of the fontforge manual at: http://fontforge.sourceforge.net/ AUTHOR
Copyright (C) 2000-2006 by George Williams (gww@silcom.com). Manual page heavily rewritten and modified to use standard -man(5) macros by R.P.C. Rodgers (rodgers@nlm.nih.gov), 23 October 2002. 8 April 2006 SFDDIFF(1)
All times are GMT -4. The time now is 09:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy