I am going to develop a address book using the shell scripting commands without sed, awk, .... I am thinking to apply the concept of 2 dimenstional array. Can I create a two dimensional array for the insertion/updation/deletion of record in unix. If yes then tell me plz or recommend me some... (1 Reply)
I am trying to implementing two dimensinal array in ksh script.Would you pls help me out.
I have a large size of file, File contains looks like
ID SID VLAUE1 VALUE2 TOTALVALUE
1 a1 01 02 03
1 b1 02 05 07 ... (2 Replies)
Hi All,
I'm writing a nagios check that will see if our ldap servers are in sync...
I got the status data into a nested array, I would like to search key of each array and if "OK" is NOT present, echo other key=>values in the current array to a variable
so...eg...let take the single array... (1 Reply)
I am writing matrix multiplication and trying to return a two dimensional array from a function but I keep getting errors. Can someone please help me?
here is my code (it is just the skeleton of my program):
void main ()
{
...
int *matmultiply (int, int, int, int , int , int )
...
}
... (4 Replies)
hi,
total newbie to shell scripting and wondering if some of you guru's can give me a hand on a problem I'm trying to solve.
The tmplsnr.a file contains
LSNR_51526
db1
db2
LSNR_51527
db3
db4
db5
Summary - depending on which db is set, the script will start the relevant listener... (5 Replies)
Hey guyz.
Here is my sample input file following by first part of my code:
* A B C D E
reg1 1 0 1 1 0
reg2 0 1 0 0 1
reg3 1 0 0 1 0
reg4 0 0 1 0 1
reg5 1 1 0 0 1
use strict;
use warnings;
open (IN, "test_input.txt") or die ("Can't open file.txt: $!\n");
my $line = <IN>; ... (2 Replies)
Hello, all
For a 1-dimensional array, such as
myarr_1=1
myarr_1=2
myarr_1=3I know I can write a loop as below to show the array member one by one:
for (i in myarr_1){print i, myarr_1}Now, suppose I have a two dimensional array such as:
myarray_2=1 myarray_2=2
myarray_2=10 myarray_2=20My... (3 Replies)
I have an array of names. Each one of the name, has a number represented to it.
For example A has an ID 8, B has an ID 2.
What I am after is a for loop that when the array is in position 1, a particular variable is set to the value of position 1 in array 2
declare -a arr=("A" "B" "C"... (6 Replies)
Hi,
I have a 10*10 two dimensional array. How do I assign value to all it's 100 elements at once? I don't want to open two for loops and assign one by one.
Thanks,
Shuri (1 Reply)
Discussion started by: shurimano
1 Replies
LEARN ABOUT MOJAVE
tap::parser::yamlish::writer5.18
TAP::Parser::YAMLish::Writer(3pm) Perl Programmers Reference Guide TAP::Parser::YAMLish::Writer(3pm)NAME
TAP::Parser::YAMLish::Writer - Write YAMLish data
VERSION
Version 3.26
SYNOPSIS
use TAP::Parser::YAMLish::Writer;
my $data = {
one => 1,
two => 2,
three => [ 1, 2, 3 ],
};
my $yw = TAP::Parser::YAMLish::Writer->new;
# Write to an array...
$yw->write( $data, @some_array );
# ...an open file handle...
$yw->write( $data, $some_file_handle );
# ...a string ...
$yw->write( $data, $some_string );
# ...or a closure
$yw->write( $data, sub {
my $line = shift;
print "$line
";
} );
DESCRIPTION
Encodes a scalar, hash reference or array reference as YAMLish.
METHODS
Class Methods
"new"
my $writer = TAP::Parser::YAMLish::Writer->new;
The constructor "new" creates and returns an empty "TAP::Parser::YAMLish::Writer" object.
Instance Methods
"write"
$writer->write($obj, $output );
Encode a scalar, hash reference or array reference as YAML.
my $writer = sub {
my $line = shift;
print SOMEFILE "$line
";
};
my $data = {
one => 1,
two => 2,
three => [ 1, 2, 3 ],
};
my $yw = TAP::Parser::YAMLish::Writer->new;
$yw->write( $data, $writer );
The $output argument may be:
o a reference to a scalar to append YAML to
o the handle of an open file
o a reference to an array into which YAML will be pushed
o a code reference
If you supply a code reference the subroutine will be called once for each line of output with the line as its only argument. Passed lines
will have no trailing newline.
AUTHOR
Andy Armstrong, <andy@hexten.net>
SEE ALSO
YAML::Tiny, YAML, YAML::Syck, Config::Tiny, CSS::Tiny, <http://use.perl.org/~Alias/journal/29427>
COPYRIGHT
Copyright 2007-2011 Andy Armstrong.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.18.2 2014-01-06 TAP::Parser::YAMLish::Writer(3pm)