Sponsored Content
Top Forums Shell Programming and Scripting Vlookup using Ask from specific column from two files Post 303014801 by ranjancom2000 on Wednesday 21st of March 2018 09:25:27 AM
Old 03-21-2018
Is there any number i need to change NR {T[$2]

Code:
awk 'FNR == NR {T[$2] = $0; next} $0 = $0 "|" (T[$NF]?T[$NF]:"Notfound")' FS="," file1 FS=" " file2

Now i have input like this. For all record it was showing Notfound



Quote:
10.62.75.120, portIndex: 247 portName: slot12 port23,20:50:00:2a:6a:00:b8:00
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Concatenate two files after a specific column

Hi I have two files, one is 1.6 GB. I would like to add one extra column of information to the large file at a specific location. After its 2nd column. For example: File 1 has two columns more than 1000 rows like this MM009987 1 File 2 looks like this MM00098 MM00076 3 4 2 4 2 1... (1 Reply)
Discussion started by: sogi
1 Replies

2. Shell Programming and Scripting

vlookup files

hi frnds i have 2 files. 1st is dddd and 2nd is ssss ==> dddd <==: 1,charit 2,gilhotra ==> ssss <==: 1,sajan 2,doda 3,hello and i want o/p ...mean join and vlookup both files sajan,charit (4 Replies)
Discussion started by: dodasajan
4 Replies

3. Shell Programming and Scripting

averaging specific column of multiple files

Hi all, I'm needing help again on scripting. I have weekly files with 3 columns, and I need to do monthly averaging on the values on column 3, the file naming convention is as follows: 20000105.u- 2000:year 01:month 05:day 20000112.u 20000119.u 20000126.u 20000202.u 20020209.u I need to... (15 Replies)
Discussion started by: ida1215
15 Replies

4. Shell Programming and Scripting

Divide data with specific column values into separate files

hello! i need a little help from you :) ... i need to split a file into separate files depending on two conditions using scripting. The file has no delimiters. The conditions are col 17 = "P" and col 81 = "*", this will go to one output file; col 17 = "R" and col 81 = " ". Here is an example. ... (3 Replies)
Discussion started by: chanclitas
3 Replies

5. Shell Programming and Scripting

Concatenating many files based on a specific column contents

Dear all, I have many files(.csv) in a directory. I want to concatenate the files which have similar entries in a particular column and save into a new file like result_datetime.csv etc. One example file is like below. Sno,Step,Data1,Data2,Data3 etc. 1,0,2,3,4 2,1,3,4,5 3,2,0,1,1 ... (4 Replies)
Discussion started by: ks_reddy
4 Replies

6. Shell Programming and Scripting

awk or sed to find specific column from different files

Hi everybody, I have a folder with many files: Files with 8 columns: X 123 A B C D E F And files with 7 columns: X1234 A B C D E F I am trying to find a way to extract the 5th column when the files have eight columns, or the 4th column when the files have... (3 Replies)
Discussion started by: Tzole
3 Replies

7. Shell Programming and Scripting

Overwrite specific column in xml file with the specific column from adjacent line

I have an xml file dumped from rrd file, that I want to "patch" so the xml file doesn't contain any blank hole in the resulting graph of the rrd file. Here is the file. <!-- 2015-10-12 14:00:00 WIB / 1444633200 --> <row><v> 4.0419731265e+07 </v><v> 4.5045912770e+06... (2 Replies)
Discussion started by: rk4k
2 Replies

8. Shell Programming and Scripting

Vlookup using Ask from specific column shell script

Input file1 frame1,dummy,server1, 00C1C N/A RDF1+TDEV RW 51789 frame1,dummy,server1, 00C1D N/A RDF1+TDEV RW 51789 frame1,dummy,server1, 00C1E N/A RDF1+TDEV RW 51789 frame1,dummy,server1, 00C1F N/A RDF1+TDEV RW 51789 frame1,dummy,server1, 00C20 N/A RDF1+TDEV RW 51789 frame1,dummy,server1,... (10 Replies)
Discussion started by: ranjancom2000
10 Replies

9. 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

10. UNIX for Beginners Questions & Answers

How do I extract specific column in multiple csv files?

file1: Name,Threshold,Curr Samples,Curr Error%,Curr ART GETHome,100,21601,0.00%,47 GETregistry,100,21592,0.00%,13 GEThomeLayout,100,30466,0.00%,17 file2: Name,Threshold,Curr Samples,Curr Error%,Curr ART GETHome,100,21601,0.00%,33 GETregistry,100,21592,0.00%,22... (6 Replies)
Discussion started by: Raghuram717
6 Replies
aliasadm(1M)						  System Administration Commands					      aliasadm(1M)

NAME
aliasadm - manipulate the NIS+ aliases map SYNOPSIS
aliasadm -a alias expansion [options comments] optional flags aliasadm -c alias expansion [ options comments] [ optional flags] aliasadm -d alias [ optional flags] aliasadm -e alias [ optional flags] aliasadm -l alias [ optional flags] aliasadm -m alias [ optional flags] aliasadm [-I] [-D domainname] [-f filename] [-M mapname] DESCRIPTION
aliasadm makes changes to the alias map. The alias map is an NIS+ table object with four columns: alias The name of the alias as a null terminated string. expansion The value of the alias as it would appear in a sendmail /etc/aliases file. options A list of options applicable to this alias. The only option currently supported is CANON. With this option, if the user has requested an inverse alias lookup, and there is more than one alias with this expansion, this alias is given prefer- ence. comments An arbitrary string containing comments about this alias. The sendmail(1M) command reads this map in addition to the NIS aliases map and the local /etc/aliases database. OPTIONS
-a Add an alias. -c Change an alias. -d Delete an alias. -e Edit the alias map. -I Initialize the NIS+ aliases database. -l List the alias map. -m Print or match an alias. -D domainname Edit the map in domain domainname instead of the current domain. -f filename When editing or listing the database, use filename instead of invoking the editor. -M mapname Edit mapname instead of mail_aliases. FILES
/etc/aliases mail aliases for the local host in ASCII format ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWnisu | +-----------------------------+-----------------------------+ SEE ALSO
sendmail(1M), attributes(5) NOTES
NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from NIS+ to LDAP are available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html. SunOS 5.10 12 Dec 2001 aliasadm(1M)
All times are GMT -4. The time now is 08:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy