Sponsored Content
Special Forums UNIX and Linux Applications SQL database call into Multidimensional Array using Perl Script Post 302586800 by eazyeddie22 on Tuesday 3rd of January 2012 09:37:25 AM
Old 01-03-2012
Thanks, a few follow up questions

Thanks you've been a big help so far. Smilie

Does the print statement only work assuming that the ID no. is 4 digits?

Also how would I traverse and operate on only the second element of each array reference.

x[0] = "1234", "Wow",
x[1] = "2222", "Yep",

I want to traverse through this and manipulate "Wow" and "Yep" and then either insert the newly manipulated back into the original array 'x' replacing the old or create an entire new array with the newly manipulated data along with the original ID no.
???
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

multidimensional array in perl

i'm trying to open a file with three or more columns and an undetermined, but finite number of rows. I want to define an array for each row with each element of the row as a sub array. The columns are separated by tabs or spaces. Here's the file: 12x3.12z34b.342sd3.sds 454.23.23.232 ... (9 Replies)
Discussion started by: prkfriryce
9 Replies

2. Shell Programming and Scripting

Awk multidimensional Array

Hello Experts,, Can anybody give me a brief idea what is following bold letter statement is for!! what is the term called so that I can google for it.. It seems to be an array inside another array.. awk' /TXADDR/ { txaddr=$NF } ##understood /TXDATA/ { txdata]=$NF... (1 Reply)
Discussion started by: user_prady
1 Replies

3. Shell Programming and Scripting

AWK multidimensional array

In a single dim. awk array, we can use : <index> in <array name> to determine whether a particualar index exists in the array or not. Is there a way to achieve this in a awk multi dim. array ? (4 Replies)
Discussion started by: sinpeak
4 Replies

4. Programming

multidimensional array using c++ vector

Hi! I need to make dynamic multidimensional arrays using the vector class. I found in this page How to dynamically create a two dimensional array? - Microsoft: Visual C++ FAQ - Tek-Tips the way to do it in 2D, and now i'm trying to expand it to 3D but i don't understand how is the operator working,... (0 Replies)
Discussion started by: carl.alv
0 Replies

5. Shell Programming and Scripting

Perl help: Creating a multidimensional array of subdirectories and its contents

I'm currently working with dozens of FASTA files, and I'm tired of having to manually change the filename in my Perl script. I'm trying to write a simple Perl script that'll create a 2-dimensional array containing the name of the folders and its contents. For example, I would like the output... (6 Replies)
Discussion started by: shwang3
6 Replies

6. Shell Programming and Scripting

perl-data from file save to multidimensional array

i have a file,like 1 3 4 5 6 7 8 9 i want to save it into an array. and then i want to get every element, because i want to use them to calculate. for example: i want to calculate 1 + 3. but i cannot reach my goal. open (FILE, "<", "number"); my @arr; while (<FILE>){ chomp;... (1 Reply)
Discussion started by: pp-zz
1 Replies

7. Shell Programming and Scripting

multidimensional array in awk

Hi, I was trying to process a file with the help of awk. I want to first display all the rows that contains 01 and at the end of processing I have to print some portion of all the lines. like below. Output expected: (2 Replies)
Discussion started by: ahmedwaseem2000
2 Replies

8. Shell Programming and Scripting

PERL : Bind 2D array to SQL

Hi, I am in the need of doing a bulk insert via : SQL - INSERT INTO <table> (SELECT..) OR PLSQL Block - FORALL i IN 1 .. count INSERT INTO <table>(arrayname(i)) I have a 2D array in my perl code which has the rows to be bulk inserted. Is there a way to bind the 2D array to the SQL... (4 Replies)
Discussion started by: sinpeak
4 Replies

9. Shell Programming and Scripting

Pass perl array to SQL oracle

Hello, Could someone please suggest if there is a way to pass an perl array(pass @v_array) to SQL as in below eg : #!/usr/bin/perl @v_array = (1,2,4,5,6,8); $db_userid = 'ni71/ni711'; $bufTPO = qx{ sqlplus -s << EOF $db_userid set verify off set feedback off set... (1 Reply)
Discussion started by: arunshankar.c
1 Replies

10. Shell Programming and Scripting

Multidimensional array

I am learning about bash system variables, such as $ , @ and #. I have this piece of script implementing an array and it is doing its job just fine. This is not the only array I will be using. Just for ease of maintenance and more coding I would like to have the arrays in two dimensional... (4 Replies)
Discussion started by: annacreek
4 Replies
Data::Dumper::Concise(3)				User Contributed Perl Documentation				  Data::Dumper::Concise(3)

NAME
Data::Dumper::Concise - Less indentation and newlines plus sub deparsing SYNOPSIS
use Data::Dumper::Concise; warn Dumper($var); is equivalent to: use Data::Dumper; { local $Data::Dumper::Terse = 1; local $Data::Dumper::Indent = 1; local $Data::Dumper::Useqq = 1; local $Data::Dumper::Deparse = 1; local $Data::Dumper::Quotekeys = 0; local $Data::Dumper::Sortkeys = 1; warn Dumper($var); } So for the structure: { foo => "bar baz", quux => sub { "fleem" } }; Data::Dumper::Concise will give you: { foo => "bar baz", quux => sub { use warnings; use strict 'refs'; 'fleem'; } } instead of the default Data::Dumper output: $VAR1 = { 'quux' => sub { "DUMMY" }, 'foo' => 'bar baz' }; (note the tab indentation, oh joy ...) If you need to get the underlying Dumper object just call "DumperObject". Also try out "DumperF" which takes a "CodeRef" as the first argument to format the output. For example: use Data::Dumper::Concise; warn DumperF { "result: $_[0] result2: $_[1]" } $foo, $bar; Which is the same as: warn 'result: ' . Dumper($foo) . ' result2: ' . Dumper($bar); DESCRIPTION
This module always exports a single function, Dumper, which can be called with an array of values to dump those values. It exists, fundamentally, as a convenient way to reproduce a set of Dumper options that we've found ourselves using across large numbers of applications, primarily for debugging output. The principle guiding theme is "all the concision you can get while still having a useful dump and not doing anything cleverer than setting Data::Dumper options" - it's been pointed out to us that Data::Dump::Streamer can produce shorter output with less lines of code. We know. This is simpler and we've never seen it segfault. But for complex/weird structures, it generally rocks. You should use it as well, when Concise is underkill. We do. Why is deparsing on when the aim is concision? Because you often want to know what subroutine refs you have when debugging and because if you were planning to eval this back in you probably wanted to remove subrefs first and add them back in a custom way anyway. Note that this -does- force using the pure perl Dumper rather than the XS one, but I've never in my life seen Data::Dumper show up in a profile so "who cares?". BUT BUT BUT ... Yes, we know. Consider this module in the ::Tiny spirit and feel free to write a Data::Dumper::Concise::ButWithExtraTwiddlyBits if it makes you happy. Then tell us so we can add it to the see also section. SUGARY SYNTAX
This package also provides: Data::Dumper::Concise::Sugar - provides Dwarn and DwarnS convenience functions Devel::Dwarn - shorter form for Data::Dumper::Concise::Sugar SEE ALSO
We use for some purposes, and dearly love, the following alternatives: Data::Dump - prettiness oriented but not amazingly configurable Data::Dump::Streamer - brilliant. beautiful. insane. extensive. excessive. try it. JSON::XS - no, really. If it's just plain data, JSON is a great option. AUTHOR
mst - Matt S. Trout <mst@shadowcat.co.uk> CONTRIBUTORS
frew - Arthur Axel "fREW" Schmidt <frioux@gmail.com> COPYRIGHT
Copyright (c) 2010 the Data::Dumper::Concise "AUTHOR" and "CONTRIBUTORS" as listed above. LICENSE
This library is free software and may be distributed under the same terms as perl itself. perl v5.18.2 2013-12-31 Data::Dumper::Concise(3)
All times are GMT -4. The time now is 04:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy