Sponsored Content
Full Discussion: vlookup files
Top Forums Shell Programming and Scripting vlookup files Post 302553615 by zaxxon on Thursday 8th of September 2011 04:16:30 AM
Old 09-08-2011
As I already wrote, did you try:
Quote:
Use nawk or /usr/xpg4/bin/awk on Solaris.
?

What about the join I posted?

You are still using no code tags when posting code, data or logs etc. Please do so - you got a PM with a guide. If that is not clear, say so, thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

merge files like VLOOKUP

I would like to merge data from a reference file and a data file to produce a new output file as shown below. Reference file,data file,output file a , b 2 , a 0 b , d 4 , b 2 c , , c 0 d , , d 4 e, , e 0 (3 Replies)
Discussion started by: godzilla07
3 Replies

2. Shell Programming and Scripting

awk script to perform an action similar to vlookup between two csv files in UNIX

Hi, I am new to awk/unix and am trying to put together an awk script to perform an action similar to vlookup between the two csv files. Here are the contents of the two files: File 1: Date,ParentID,Number,Area,Volume,Dimensions 2014-01-01,ABC,247,83430.33,857.84,8110.76... (9 Replies)
Discussion started by: Prit Siv
9 Replies

3. Shell Programming and Scripting

Vlookup using awk

Hi folks, awk 'NR==FNR {m=$0; next} $1 in m{$0=m} {print}' file2 file1 Works a charm for a vlookup type query, sourced from https://www.unix.com/shell-programming-and-scripting/215998-vlookup-using-awk.html However my column content has white spaces and numbers. Example file1 The Man... (6 Replies)
Discussion started by: pshields1984
6 Replies

4. Shell Programming and Scripting

Vlookup in Linux

Hello Everybody I am looking for vlookup like functionality in Linux since two files I have are very big(1000MB each) and its not opening completely in excel. Here the requirement file1 11,12,13 16,14,12 28,21,22 22,23,24 file 3 18,16,16 14,12,12 23,22,24 16,11,13 here... (8 Replies)
Discussion started by: shanul karim
8 Replies

5. Shell Programming and Scripting

Vlookup using awk non similar files

I need to vlookup and check the server not found. Source file 1 server1 server2 server3 server4 server5_root server6_silver server7 server7-test server7-temp Source file 2 server1_bronze (6 Replies)
Discussion started by: ranjancom2000
6 Replies

6. Shell Programming and Scripting

Vlookup using Ask from specific column from two files

File1 alias:server1_00,20:f1:0a:25:b5:03:02:90 alias:server2_00,20:f1:0a:25:b5:03:02:91 alias:server3_00,50:00:09:75:50:0d:bd:da alias:server4_00,20:f1:0a:25:b5:03:02:93 alias:server5_00,21:00:00:24:ff:8b:e1:fe alias:server6_00,50:00:09:75:50:08:54:44... (17 Replies)
Discussion started by: ranjancom2000
17 Replies

7. Shell Programming and Scripting

Conditional Vlookup

Hi everyone, I need to replace values of column 2 array1 with values of column 2 array2 based on a lookup of column 4 value, but only return a value IF the values in column 1 of BOTH array1 and array2 match, otherwise keep original value in column 2 of array1. Both files are tab delimited... (2 Replies)
Discussion started by: Geneanalyst
2 Replies

8. UNIX for Beginners Questions & Answers

Vlookup on 2 files - inserting vlookup command on another command

Hello, i am trying to print group name column(etc/group) on script (etc/passwd) since group name is not listed on etc/passwd columns. Im trying to do a vlookup. but i cant figure out how i can insert the vlookup command FNR==NR inside the print out command or the output. I also tried exporting... (2 Replies)
Discussion started by: joonisio
2 Replies

9. UNIX for Beginners Questions & Answers

Vlookup not using awk

Hi I just want again to ask for help on what command to use to vlookup f1 group name in "/etc/group" matching f3 of it to "/etc/passwd" f4. I do need to display group name in the output of /etc/passwd without using awk or NR==FNR command. thank you while IFS=: read -r f1 f2 f3 f4 f5 f6 f7... (4 Replies)
Discussion started by: joonisio
4 Replies

10. UNIX for Beginners Questions & Answers

How to compare two files in UNIX using similar to vlookup?

Hi, I want to compare same column in two files, if values match then display the column or display "NA". Ex : File 1 : 123 abc xyz pqr File 2: 122 aab fdf pqr fff qqq rrr (1 Reply)
Discussion started by: hkoshekay
1 Replies
apply(n)						       Tcl Built-In Commands							  apply(n)

__________________________________________________________________________________________________________________________________________________

NAME
apply - Apply an anonymous function SYNOPSIS
apply func ?arg1 arg2 ...? _________________________________________________________________ DESCRIPTION
The command apply applies the function func to the arguments arg1 arg2 ... and returns the result. The function func is a two element list {args body} or a three element list {args body namespace} (as if the list command had been used). The first element args specifies the formal arguments to func. The specification of the formal arguments args is shared with the proc com- mand, and is described in detail in the corresponding manual page. The contents of body are executed by the Tcl interpreter after the local variables corresponding to the formal arguments are given the val- ues of the actual parameters arg1 arg2 .... When body is being executed, variable names normally refer to local variables, which are cre- ated automatically when referenced and deleted when apply returns. One local variable is automatically created for each of the function's arguments. Global variables can only be accessed by invoking the global command or the upvar command. Namespace variables can only be accessed by invoking the variable command or the upvar command. The invocation of apply adds a call frame to Tcl's evaluation stack (the stack of frames accessed via uplevel). The execution of body pro- ceeds in this call frame, in the namespace given by namespace or in the global namespace if none was specified. If given, namespace is interpreted relative to the global namespace even if its name does not start with "::". The semantics of apply can also be described by: proc apply {fun args} { set len [llength $fun] if {($len < 2) || ($len > 3)} { error "can't interpret "$fun" as anonymous function" } lassign $fun argList body ns set name ::$ns::[getGloballyUniqueName] set body0 { rename [lindex [info level 0] 0] {} } proc $name $argList ${body0}$body set code [catch {uplevel 1 $name $args} res opt] return -options $opt $res } EXAMPLES
This shows how to make a simple general command that applies a transformation to each element of a list. proc map {lambda list} { set result {} foreach item $list { lappend result [apply $lambda $item] } return $result } map {x {return [string length $x]:$x}} {a bb ccc dddd} -> 1:a 2:bb 3:ccc 4:dddd map {x {expr {$x**2 + 3*$x - 2}}} {-4 -3 -2 -1 0 1 2 3 4} -> 2 -2 -4 -4 -2 2 8 16 26 The apply command is also useful for defining callbacks for use in the trace command: set vbl "123abc" trace add variable vbl write {apply {{v1 v2 op} { upvar 1 $v1 v puts "updated variable to "$v"" }}} set vbl 123 set vbl abc SEE ALSO
proc(n), uplevel(n) KEYWORDS
argument, procedure, anonymous function Tcl apply(n)
All times are GMT -4. The time now is 09:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy