Sponsored Content
Top Forums Shell Programming and Scripting AWK help. how to compare a variable with a data array in AWK? Post 302413763 by usustarr on Friday 16th of April 2010 10:10:09 PM
Old 04-16-2010
i know. Before i add the while loop, it used to work error free. i had to add this extra code. How do i convert this new part to AWK?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK program with array variable

Hi, I made a small awk program just to test array variables. I couldn't find anything wrong with it. But it doesn't give out valid numbers.( just 0.00 ) Do you see any problem that I didn't see? Thanks in advance! Here is the program: ################################## BEGIN { FS =... (4 Replies)
Discussion started by: whatisthis
4 Replies

2. Shell Programming and Scripting

AWK - compare $0 to regular expression + variable

Hi, I have this script: awk -v va=45 '$0~va{print}' flo2 That returns: "4526745 1234 " (this is the only line of the file "flo2". However, I would like to get "va" to match the begining of the line, so that is "va" is different than 45 (eg. 67, 12 ...) I would not have any output. That... (3 Replies)
Discussion started by: jolecanard
3 Replies

3. Shell Programming and Scripting

AWK help: how to compare array elements against a variable

i have an array call ignore. it is set up ignore=34th56 ignore=re45ty ignore=rt45yu . . ignore=rthg34 n is a variable. I have another variable that i read from a different file. It is $2 and it is working the way i expect. array ignore read and print correct values. in the below if... (2 Replies)
Discussion started by: usustarr
2 Replies

4. Shell Programming and Scripting

awk, associative array, compare files

i have a file like this < '393200103052';'H3G';'20081204' < '393200103059';'TIM';'20110111' < '393200103061';'TIM';'20060206' < '393200103064';'OPI';'20110623' > '393200103052';'HKG';'20081204' > '393200103056';'TIM';'20110111' > '393200103088';'TIM';'20060206' Now i have to generate a file... (9 Replies)
Discussion started by: shruthi123
9 Replies

5. UNIX for Dummies Questions & Answers

awk unable to compare the shell variable

Hi Could anyone please help with Awk. The below code prints the PID of the matching process with condition with $8 and $9 ps -ef |awk '($8~/proc/) && ($9~/rPROC2/) {print $2}' Now i want to change the Constant PROC2 from Shell variable PROC2 is already declared in shell variable SRVNAME... (9 Replies)
Discussion started by: rakeshkumar
9 Replies

6. Shell Programming and Scripting

awk arrays - compare value in second column to variable

Hello, I am trying to redirect files to a directory by using a config file. The config files is as such: xxxxxx,ID,PathToDirectory xxxxxx,ID2,PathToDirectory2 and so on... I have a variable that should match one of these IDs. I want to load this config file into an awk array, and... (2 Replies)
Discussion started by: jrfiol
2 Replies

7. Shell Programming and Scripting

HELP with AWK one-liner. Need to employ an If condition inside AWK to check for array variable ?

Hello experts, I'm stuck with this script for three days now. Here's what i need. I need to split a large delimited (,) file into 2 files based on the value present in the last field. Samp: Something.csv bca,adc,asdf,123,12C bca,adc,asdf,123,13C def,adc,asdf,123,12A I need this split... (6 Replies)
Discussion started by: shell_boy23
6 Replies

8. Shell Programming and Scripting

awk - filtering data by if --> into an array

Hi my data is in csv-format ... ... 13/08/2012,16:30,303.30,5.10,3,2,2,1,9360.0,322 13/08/2012,16:40,305.50,5.00,3,2,2,1,12360.0,322 13/08/2012,16:50,319.90,3.80,3,2,1,0,2280.0 13/08/2012,17:00,326.10,3.50,3,2,1,1,4380.0,321 13/08/2012,17:10,333.00,3.80,3,3,1,0,2280.0... (1 Reply)
Discussion started by: IMPe
1 Replies

9. Homework & Coursework Questions

awk - filtering data by if --> into an array

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: my data in csv-format ... ... 13/08/2012,16:30,303.30,5.10,3,2,2,1,9360.0,322... (13 Replies)
Discussion started by: IMPe
13 Replies

10. Shell Programming and Scripting

Compare two files and write data to second file using awk

Hi Guys, I wanted to compare a delimited file and positional file, for a particular key files and if it matches then append the positional file with some data. Example: Delimited File -------------- Byer;Amy;NONE1;A5218257;E5218257 Byer;Amy;NONE1;A5218260;E5218260 Positional File... (3 Replies)
Discussion started by: Ajay Venkatesan
3 Replies
ldns(3) 						     Library Functions Manual							   ldns(3)

NAME
ldns_rdf2buffer_str_a, ldns_rdf2buffer_str_aaaa, ldns_rdf2buffer_str_str, ldns_rdf2buffer_str_b64, ldns_rdf2buffer_str_hex, ldns_rdf2buf- fer_str_type, ldns_rdf2buffer_str_class, ldns_rdf2buffer_str_alg, ldns_rdf2buffer_str_loc, ldns_rdf2buffer_str_unknown, ldns_rdf2buf- fer_str_nsap, ldns_rdf2buffer_str_wks, ldns_rdf2buffer_str_nsec, ldns_rdf2buffer_str_period, ldns_rdf2buffer_str_tsigtime, ldns_rdf2buf- fer_str_apl, ldns_rdf2buffer_str_int16_data, ldns_rdf2buffer_str_int16, ldns_rdf2buffer_str_ipseckey SYNOPSIS
#include <stdint.h> #include <stdbool.h> #include <ldns/ldns.h> ldns_status ldns_rdf2buffer_str_a(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_aaaa(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_str(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_b64(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_hex(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_type(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_class(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_alg(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_loc(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_unknown(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_nsap(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_wks(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_nsec(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_period(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_tsigtime(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_apl(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_int16_data(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_int16(ldns_buffer *output, const ldns_rdf *rdf); ldns_status ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf); DESCRIPTION
ldns_rdf2buffer_str_a() Converts an LDNS_RDF_TYPE_A rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_aaaa() Converts an LDNS_RDF_TYPE_AAAA rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_str() Converts an LDNS_RDF_TYPE_STR rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_b64() Converts an LDNS_RDF_TYPE_B64 rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_hex() Converts an LDNS_RDF_TYPE_HEX rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_type() Converts an LDNS_RDF_TYPE_TYPE rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_class() Converts an LDNS_RDF_TYPE_CLASS rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_alg() Converts an LDNS_RDF_TYPE_ALG rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_loc() Converts an LDNS_RDF_TYPE_LOC rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_unknown() Converts an LDNS_RDF_TYPE_UNKNOWN rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_nsap() Converts an LDNS_RDF_TYPE_NSAP rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_wks() Converts an LDNS_RDF_TYPE_WKS rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_nsec() Converts an LDNS_RDF_TYPE_NSEC rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_period() Converts an LDNS_RDF_TYPE_PERIOD rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_tsigtime() Converts an LDNS_RDF_TYPE_TSIGTIME rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_apl() Converts an LDNS_RDF_TYPE_APL rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_int16_data() Converts an LDNS_RDF_TYPE_INT16_DATA rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_int16() Converts an LDNS_RDF_TYPE_INT16 rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure ldns_rdf2buffer_str_ipseckey() Converts an LDNS_RDF_TYPE_IPSECKEY rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The buffer to add the data to Returns LDNS_STATUS_OK on success, and error status on failure AUTHOR
The ldns team at NLnet Labs. Which consists out of Jelte Jansen and Miek Gieben. REPORTING BUGS
Please report bugs to ldns-team@nlnetlabs.nl or in our bugzilla at http://www.nlnetlabs.nl/bugs/index.html COPYRIGHT
Copyright (c) 2004 - 2006 NLnet Labs. Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSO
perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035. REMARKS
This manpage was automaticly generated from the ldns source code by use of Doxygen and some perl. 30 May 2006 ldns(3)
All times are GMT -4. The time now is 07:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy