I was trying to do this using just basic arrays which I am more familiar with but it seems to be more complicated to try to do it that way. I haven't tried using hashes yet, I'm pretty new to perl, I only use it every now and then to do some things with data that excel and my stats program...
I'm trying to get started on some basic processing of data in array form. Basically this is a segment of what the data file looks like:
20070314180137 1003 1 641 1
20070314180137 1003 3 598 9
20070314180137 1003 4...
What I want to do is compare two arrays, one is just a vector with a single column, the other is multidimensional. I want to look at the 3 column in the multidimensional array and compare it to the single column in the other array and remove all of the lines from the multidimensional array for...
I have this line of code:
$prelimResult = mysql_query("SELECT MAX(volume),MAX(issue),MAX(year) FROM articles",$db);
That doesn't work quite how I want it to. I want it to find the largest volume, then the largest issue within that volume but instead this finds the largest volume...
mikevh, Sure that works for printing but that's not what I want to do with it. I'm going to be doing some more complicated things for which I need everything to be in one array where I can access specific elements.
What Siberian suggested is too simple to work, but if I went along those...
That would work if I just wanted to print it out, but I want to be able to work with the individual elements later on. With that example it puts everything from a line into one element resulting in a single dimensional array, but I need to refer to specific elements like the "A" in...
I contacted EPrime about my problem and this is all they would tell me. I don't understand it, but perhaps it would be helpful:
"The most common methods to call and access external rograms would be via OLE/COM Automation or via DLL calls via Declare statements. The use of these methods...
I'm actually using E-Basic (with the E-Prime software) but I'm told most VB commands will work.
I'm using the E-Prime software to run an experiment, the software does not explicitely support playing a video stimuli but the E-prime support tells me that I can put in code like this...
I have Learning Perl (and I read the entire thing) it doesn't even cover multidim arrays. I just got the Programming Perl book yesterday and am working on going through it.
I read somewhere in the perldoc that @array[1]->[2] and @array[1][2] mean exactly the same thing, is this not the case...
I can't figure out what is wrong with my code. It's supposed to create an array and print it out, but nothing prints, I don't get any error messages or anything.
Here is my code:
while (<>) {
chomp;
push @isr, [split/\t/];
}
for my $i(0..$#isr){
if ($isr[$i][5] eq...
I'm not understanding how to create a multidimensional array by reading lines from a file.
So say I have a file like this:
0 1 2 3
4 5 6 7
8 9 10 11
With lines of numbers separated by tabs.
I would have something like this to read the lines from the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.