Sponsored Content
Top Forums Shell Programming and Scripting Question on awk for finding the column number using a match word Post 302451139 by agama on Sunday 5th of September 2010 11:06:39 PM
Old 09-06-2010
Quote:
Originally Posted by mallak
Thanks a lot

So i understood that using above code awk will scan each line and will return values 1 and 2

asnapply 1 2 3 apply_schema=ASN
asnapply 1 2 3 apply_server=2 apply_schema=ASN

Thanks once again for the reply
No, it will find the whole string apply_server=1; If you need it to find just the value after the equal, use this:

Code:
split( substr( $0, RSTART, RLENGTH ), a, "=");   # split the token at the =
value = a[2];                           # everything after equal is in a[2]

This User Gave Thanks to agama For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

finding the number of occurence of a word in a line

suppose i have this line abs|der|gt|dftnrk|dtre i want to count the number of "|" in this line.. how can i do that. plz help:confused: (9 Replies)
Discussion started by: priyanka3006
9 Replies

2. Shell Programming and Scripting

Finding multiple column values and match in a fixed length file

Hi, I have a fixed length file where I need to verify the values of 3 different fields, where each field will have a different value. How can I do that in a single step. (6 Replies)
Discussion started by: naveen_sangam
6 Replies

3. UNIX for Dummies Questions & Answers

AWK lookup not finding match

Hello everyone, I have been struggling with the following situation, I think I am doing something wrong, can anyone help? I have 2 comma separated files, the first is a look-up table that will supply the phone number based on the customer id, the second is a file containing customers and their... (4 Replies)
Discussion started by: gio001
4 Replies

4. Shell Programming and Scripting

Awk or Sed, fubd match in column, then edit column.

FILE A: 9780743551526,(Abridged) 9780743551779,(Unabridged) 9780743582469,(Abridged) 9780743582483,(Unabridged) 9780743563468,(Abridged) 9780743563475,(Unabridged) FILE B: c3saCandyland 9780743518321 "CANDYLAND" "MCBAIN, ED" 2001 c3sbCandyland 9780743518321 ... (7 Replies)
Discussion started by: glev2005
7 Replies

5. Shell Programming and Scripting

finding number in exact column

Dear all, I want to find a number in exact column but I don't know how to do it. Here is the thing, data is shown below, and I want to find 416 in the first column and print it out, how should I deal with it? Thank you very much! ab33 50S01S 958 279.068999 67.251013 -150.172544 67.250000... (5 Replies)
Discussion started by: handsonzhao
5 Replies

6. Shell Programming and Scripting

Finding log files that match number pattern

I have logs files which are generated each day depending on how many processes are running. Some days it could spin up 30 processes. Other days it could spin up 50. The log files all have the same pattern with the number being the different factor. e.g. LOG_FILE_1.log LOG_FILE_2.log etc etc ... (2 Replies)
Discussion started by: atelford
2 Replies

7. Shell Programming and Scripting

awk match whole word using a variable

Hello, I am writing a script in awk where I need to match a whole word that is stored inside a variable. For example: I am working on a text that looks like this, and I want to print the second row: sfasfsomethingsfasf this is something I can use this is not somethingIcanuse ... (12 Replies)
Discussion started by: avi.levi
12 Replies

8. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

9. Shell Programming and Scripting

Finding a word with awk or sed

Hello, in a AIX system : AIX CDRATE01 2 7 00FAB3114C00 my following commande give the result : LISTE /tmp/RESS **************************************************************** Liste TYPE = XXXXXXX EX = YYYY VER ... (13 Replies)
Discussion started by: sam01
13 Replies

10. UNIX for Beginners Questions & Answers

How to search for a word in column header that fully matches the word not partially in awk?

I have a multicolumn text file with header in the first row like this The headers are stored in an array called . which contains I want to search for each elements of this array from that multicolumn text file. And I am using this awk approach for ii in ${hdr} do gawk -vcol="$ii" -F... (1 Reply)
Discussion started by: Atta
1 Replies
libtasn1(3)							   User Commands						       libtasn1(3)

NAME
libtasn1 - a library for Abstract Syntax Notation One (ASN.1) DESCRIPTION
libtasn1 is a library for Abstract Syntax Notation One (ASN.1) and Distinguish Encoding Rules (DER) manipulation. The main features of this library are: o On line ASN.1 structure management that does not require any C code file generation. o Off line ASN.1 structure management with C code file generation containing an array o DER (Distinguish Encoding Rules) encoding o No limits for INTEGER and ENUMERATED values o It is thread-safe. No global variables are used and multiple library handles and session handles may be used in parallel o It is portable. It should work on all UNIX-like operating systems, including Windows. The library itself should be portable to any C89 system, not even POSIX is required FILES
The following files are used by this application: /usr/lib/libtasn1.so libtasn1 shared library ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWlibtasn1 | +-----------------------------+-----------------------------+ |Interface stability |Volatile | +-----------------------------+-----------------------------+ SEE ALSO
libgnutls(1), attributes(5), gnome-interfaces(5) http://josefsson.org/gnutls/manual/libtasn1/libtasn1.html NOTES
Written by Jeff Cai, Sun Microsystems Inc., 2008. SunOS 5.11 16 Jun 2008 libtasn1(3)
All times are GMT -4. The time now is 04:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy