Sponsored Content
Full Discussion: array in awk
Top Forums Shell Programming and Scripting array in awk Post 302533894 by erik80 on Saturday 25th of June 2011 10:23:35 AM
Old 06-25-2011
thanks! Smilie i knew it must be something stupid
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Array in awk

Hi, How can find Array is NULL or not. i wrote script using arrays but i want dislpy an message if arrary was Empty. pls help me on this. (2 Replies)
Discussion started by: koti_rama
2 Replies

2. Shell Programming and Scripting

array on awk

I have a raw data file: 70,1,1,-53.25 70,1,1,,,,-57.50 70,1,1,,,,,,,,,,-48.00 I want to have a output file with the formatting below: 70,1,1,-53.25,,,,-57.50,,,,,-48.00 I mean if these rows have the first similar three variables which will be group into one row. And I try to write a... (1 Reply)
Discussion started by: anhtt
1 Replies

3. Shell Programming and Scripting

Use of AWK as array

Dear Experts, I have a file containing text like below 123 456 789 012 345 I want to save each line in array. and print each array index as per my requirement. For Example array will print 456 array will print 012 Thanks for your Help. (14 Replies)
Discussion started by: Danish Shakil
14 Replies

4. Shell Programming and Scripting

AWK help. how to compare a variable with a data array in AWK?

Hi all, i have a data array as follows. array=ertfgj2345 array=456ttygkd . . . array=errdjt3235 so number or elements in the array can varies depending on how big the data input is. now i have a variable, and it is $1 (there are $2, $3 and so on, i am only interested in $1). ... (9 Replies)
Discussion started by: usustarr
9 Replies

5. Shell Programming and Scripting

array in awk

Hi I am trying to get data from an array and input it into awk. Please see below: ### #!/bin/bash #declare array declare -a ARRAY exec 10</path/to/arrayfile let count=0 while read LINE <&10; do ARRAY=$LINE ((count++)) done #close file exec 10>&- ENDLOOP=0 (10 Replies)
Discussion started by: rocket_dog
10 Replies

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

7. Shell Programming and Scripting

Array from awk

I'm trying to get the output from awk into a bash array. Here is my script. #!/bin/bash while : do app=$( osascript -e "tell application \"System Events\" to return name of every process whose frontmost is true" ) echo "$app" if ava ]] then ps -ax | grep -v awk | pids=( $(awk... (5 Replies)
Discussion started by: nextyoyoma
5 Replies

8. Shell Programming and Scripting

How to Assign an shell array to awk array?

Hello All, Can you please help me with the below. #!/bin/bash ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1" ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
Discussion started by: Ariean
14 Replies

9. Shell Programming and Scripting

awk loop using array:wish to store array values from loop for use outside loop

Here's my code: awk -F '' 'NR==FNR { if (/time/ && $5>10) A=$2" "$3":"$4":"($5-01) else if (/time/ && $5<01) A=$2" "$3":"$4-01":"(59-$5) else if (/time/ && $5<=10) A=$2" "$3":"$4":0"($5-01) else if (/close/) { B=0 n1=n2; ... (2 Replies)
Discussion started by: klane
2 Replies

10. UNIX for Beginners Questions & Answers

awk array

Hello. I'm trying to figure out which one of these is not true about an awk array. -You do not need to formally declare an array; it is created automatically on first assignment -Array elements can only be addressed using an index ... (1 Reply)
Discussion started by: Eric7giants
1 Replies
Pod::Eventual(3)					User Contributed Perl Documentation					  Pod::Eventual(3)

NAME
Pod::Eventual - read a POD document as a series of trivial events VERSION
version 0.093330 SYNOPSIS
package Your::Pod::Parser; our $VERSION = '0.093330'; use base 'Pod::Eventual'; sub handle_event { my ($self, $event) = @_; print Dumper($event); } DESCRIPTION
POD is a pretty simple format to write, but it can be a big pain to deal with reading it and doing anything useful with it. Most existing POD parsers care about semantics, like whether a "=item" occurred after an "=over" but before a "back", figuring out how to link a "L<>", and other things like that. Pod::Eventual is much less ambitious and much more stupid. Fortunately, stupid is often better. (That's what I keep telling myself, anyway.) Pod::Eventual reads line-based input and produces events describing each POD paragraph or directive it finds. Once complete events are immediately passed to the "handle_event" method. This method should be implemented by Pod::Eventual subclasses. If it isn't, Pod::Eventual's own "handle_event" will be called, and will raise an exception. METHODS
read_handle Pod::Eventual->read_handle($io_handle, \%arg); This method iterates through the lines of a handle, producing events and calling the "handle_event" method. The only valid argument in %arg (for now) is "in_pod", which indicates whether we should assume that we are parsing pod when we start parsing the file. By default, this is false. This is useful to behave differently when reading a .pm or .pod file. read_file This behaves just like "read_handle", but expects a filename rather than a handle. read_string This behaves just like "read_handle", but expects a string containing POD rather than a handle. handle_event This method is called each time Pod::Evental finishes scanning for a new POD event. It must be implemented by a subclass or it will raise an exception. handle_nonpod This method is called each time a non-POD segment is seen -- that is, lines after "=cut" and before another command. If unimplemented by a subclass, it does nothing by default. handle_blank This method is called at the end of a sequence of one or more blank lines. If unimplemented by a subclass, it does nothing by default. EVENTS
There are four kinds of events that Pod::Eventual will produce. All are represented as hash references. Command Events These events represent commands -- those things that start with an equals sign in the first column. Here are some examples of POD and the event that would be produced. A simple header: =head1 NAME { type => 'command', command => 'head1', content => "NAME ", start_line => 4 } Notice that the content includes the trailing newline. That's to maintain similarity with this possibly-surprising case: =for HTML We're actually still in the command event, here. { type => 'command', command => 'for', content => "HTML We're actually still in the command event, here. ", start_line => 8, } Pod::Eventual does not care what the command is. It doesn't keep track of what it's seen or whether you've used a command that isn't defined. The only special case is "=cut", which is never more than one line. =cut We are no longer parsing POD when this line is read. { type => 'command', command => 'cut', content => " ", start_line => 15, } Waiving this special case may be an option in the future. Text Events A text event is just a paragraph of text, beginning after one or more empty lines and running until the next empty line (or =cut). In Perl 5's standard usage of Pod, text content that begins with whitespace is a "verbatim" paragraph, and text content that begins with non- whitespace is an "ordinary" paragraph. Pod::Eventual doesn't care. Text events look like this: { type => 'text', content => "a string of text ending with a ", start_line => 16, } Blank events These events represent blank lines (or many blank lines) within a Pod section. Blank events look like this: { type => 'blank', content => " ", start_line => 21, } Non-Pod events These events represent non-Pod segments of the input. Non-Pod events look like this: { type => 'nonpod', content => "#!/usr/bin/perl use strict; use Acme::ProgressBar ", start_line => 1, } AUTHOR
Ricardo SIGNES <rjbs@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2009 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.16.3 2009-11-29 Pod::Eventual(3)
All times are GMT -4. The time now is 10:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy