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.
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)
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)
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)
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)
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)
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)
#!/usr/local/bin/perl
use DBI;
use File::Copy;
use Time::Local;
use Data::Dumper;
-Comments Describing what I'm doing--------------
-I'm pulling information from a database that has an ID and Name. They are separated by a space and I'm trying to load them into a multidimensional array so as... (3 Replies)
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)
Hello
I have a problem.
I create a Multidimensional Array Like this:
ENTRY="$kunnum-$host"
ENTRY="$host"
ENTRY="# $3"
for key in "${!ENTRY}"; do
ENTRIES=${ENTRY} # INDEX=IP(5)
donedeclare -p
declare -A ENTRIES=(="unas15533" ="unas" ="# RDP-Terminal 2"... (12 Replies)
Discussion started by: Marti95
12 Replies
LEARN ABOUT OSX
io::lines5.12
IO::Lines(3) User Contributed Perl Documentation IO::Lines(3)NAME
IO::Lines - IO:: interface for reading/writing an array of lines
SYNOPSIS
use IO::Lines;
### See IO::ScalarArray for details
DESCRIPTION
This class implements objects which behave just like FileHandle (or IO::Handle) objects, except that you may use them to write to (or read
from) an array of lines. They can be tiehandle'd as well.
This is a subclass of IO::ScalarArray in which the underlying array has its data stored in a line-oriented-format: that is, every element
ends in a "
", with the possible exception of the final element. This makes "getline()" much more efficient; if you plan to do line-
oriented reading/printing, you want this class.
The "print()" method will enforce this rule, so you can print arbitrary data to the line-array: it will break the data at newlines
appropriately.
See IO::ScalarArray for full usage and warnings.
VERSION
$Id: Lines.pm,v 1.3 2005/02/10 21:21:53 dfs Exp $
AUTHORS
Primary Maintainer
David F. Skoll (dfs@roaringpenguin.com).
Principal author
Eryq (eryq@zeegee.com). President, ZeeGee Software Inc (http://www.zeegee.com).
Other contributors
Thanks to the following individuals for their invaluable contributions (if I've forgotten or misspelled your name, please email me!):
Morris M. Siegel, for his $/ patch and the new "getlines()".
Doug Wilson, for the IO::Handle inheritance and automatic tie-ing.
perl v5.12.5 2005-02-10 IO::Lines(3)