Sponsored Content
Top Forums Shell Programming and Scripting use python or awk to match names 'with error tolerance' Post 302292847 by grossgermany on Sunday 1st of March 2009 07:42:18 PM
Old 03-01-2009
Thanks a lot for the reply, but is it possible to create manual translation tables:

Suppose the file is now
A.csv
Toyota Camry,1998,blue
Honda Civic,1999,blue
Acura Inf,2000,yellow

B.csv
Toyota Inc. Camry, 2000km
Honda Corp Civic,1500km
HondaUSA Inf, 2000, 2300km

I want to generate C.csv
Toyota Camry,1998,blue ,2000km
Honda Civic,1999,blue,1500km
HondaUSA Inf,2000,yellow,2300km

How to generate a list of translation table which would say: Acura translates to HondaUSA
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Patern Match Question on file names

I have a script which I use to archive log files and I want to install it on another server. I match any file with a ".log" in the name. Most files end with ".log" or ".log.nnnn". Of course someone has a file on this server that they do not want to archive that has .login.ear in the file name and... (1 Reply)
Discussion started by: prismtx
1 Replies

2. Shell Programming and Scripting

Assign 1,2,3 according to the names using Awk

Print same letters as 1 or 3 (ex:a/a)and different letters as 2 (ex:a/b) based on Name and subname 1st column indicates main names (ex: ID1 is one main name) and 2nd column indicates sub names (ex: a1 is a subname of ID1) and 3rd column indicates sub-sub names (ex: a/b is a sub-sub name of... (6 Replies)
Discussion started by: ruby_sgp
6 Replies

3. UNIX for Dummies Questions & Answers

awk display the match and 2 lines after the match is found.

Hello, can someone help me how to find a word and 2 lines after it and then send the output to another file. For example, here is myfile1.txt. I want to search for "Error" and 2 lines below it and send it to myfile2.txt I tried with grep -A but it's not supported on my system. I tried with awk,... (4 Replies)
Discussion started by: eurouno
4 Replies

4. Shell Programming and Scripting

Printing names using awk?

Mike Harrington:(510) 548-1278:250:100:175 Christian Dobbins:(408) 538-2358:155:90:201 Susan Dalsass:(206) 654-6279:250:60:50 Need to learn how to print each record preceded by the number of the record using awk. awk -F '|' '{print NF}'would it be... (2 Replies)
Discussion started by: JA50
2 Replies

5. Shell Programming and Scripting

Finding contiguous numbers in a list but with a gap number tolerance

Dear all, I have a imput file like this imput scaffold_0 10558458 10558459 1.8 scaffold_0 10558464 10558465 1.75 scaffold_0 10558467 10558468 1.8 scaffold_0 10558468 10558469 1.71428571428571 scaffold_0 10558469... (5 Replies)
Discussion started by: valente
5 Replies

6. Programming

Python re.findall inverse Match

I ask of you but yet another simplistic question that I hope can be answered. Its better explained showing my code. Here is my list(tmp_pkglist), which contains a list of all Debian (Jessie) packages: snippet 'zssh (1.5c.debian.1-3.2+b1 , 1.5c.debian.1-3.2 )', 'zsync (0.6.2-1)', 'ztex-bmp... (2 Replies)
Discussion started by: metallica1973
2 Replies

7. Shell Programming and Scripting

Python fails to detect String Match Found

Below is my code for comparing string for Exact Match found in python. for word in jdbc_trgt.split(','): global comp comp=word.strip(); print "GloBAL:" + comp fiIn = open('list.txt').readlines() for lines in fiIn: print "line1s:" +... (6 Replies)
Discussion started by: mohtashims
6 Replies

8. Shell Programming and Scripting

awk to match field between two files and use conditions on match

I am trying to look for $2 of file1 (skipping the header) in $2 of file2 (skipping the header) and if they match and the value in $10 is > 30 and $11 is > 49, then print the line from file1 to a output file. If no match is foung the line is not printed. Both the input and output are tab-delimited.... (3 Replies)
Discussion started by: cmccabe
3 Replies

9. Shell Programming and Scripting

awk to update file based on partial match in field1 and exact match in field2

I am trying to create a cronjob that will run on startup that will look at a list.txt file to see if there is a later version of a database using database.txt as the source. The matching lines are written to output. $1 in database.txt will be in list.txt as a partial match. $2 of database.txt... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. Shell Programming and Scripting

awk to print match or non-match and select fields/patterns for non-matches

In the awk below I am trying to output those lines that Match between file1 and file2, those Missing in file1, and those missing in file2. Using each $1,$2,$4,$5 value as a key to match on, that is if those 4 fields are found in both files the match, but if those 4 fields are not found then missing... (0 Replies)
Discussion started by: cmccabe
0 Replies
atan2(3M)						  Mathematical Library Functions						 atan2(3M)

NAME
atan2, atan2f, atan2l - arc tangent function SYNOPSIS
c99 [ flag... ] file... -lm [ library... ] #include <math.h> double atan2(double y, double x); float atan2f(float y, float x); long double atan2l(long double y, long double x); DESCRIPTION
These functions compute the principal value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value. RETURN VALUES
Upon successful completion, these functions return the arc tangent of y/x in the range [ -pi,pi ] radians. If y is +-0 and x is < 0, +-pi is returned. If y is +-0 and x is > 0, +-0 is returned. If y is < 0 and x is +-0, -pi/2 is returned. If y is > 0 and x is +-0, pi/2 is returned. If x is 0, a pole error does not occur. If either x or y is NaN, a NaN is returned. If y is +-0 and x is -0, +-pi is returned. If y is +-0 and x is +0, +-0 is returned. For finite values of +-y > 0, if x is -Inf, +-pi is returned. For finite values of +-y > 0, if x is +Inf, +-0 is returned. For finite values of x, if y is +-Inf, +-pi/2 is returned. If y is +-Inf and x is -Inf, +-3pi/4 is returned. If y is +-Inf and x is +Inf, +-pi/4 is returned. If both arguments are 0, a domain error does not occur. ERRORS
No errors are defined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
atan(3M), isnan(3M), math.h(3HEAD)tan(3M), attributes(5), standards(5) SunOS 5.11 12 Jul 2006 atan2(3M)
All times are GMT -4. The time now is 07:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy