in reply to Re: How do I select first string of a two dimensional array to compare to other values?
in thread How do I select first string of a two dimensional array to compare to other values?
Thank you for the welcome! Let me try to clarify things a bit. This is the input-
1424621700, 2015-02-22 16:15:00, 4294.700 1424621760, 2015-02-22 16:16:00, 4289.700 1424621820, 2015-02-22 16:17:00, 4299.800 1424621880, 2015-02-22 16:18:00, 4302.800 1424621940, 2015-02-22 16:19:00, 4296.900 1424622000, 2015-02-22 16:20:00, 4301.000
I'm trying to run it through this script (fixed from above)-
#!/usr/bin/perl use strict; use warnings; my $file = $ARGV[0]; open (RAW, "./$file") or die "Can't open $file for read: $!"; open (OUT, ">./OUTPUT_$file") or die "Can't open Output_$file: $!"; while(<RAW>) { my $line = $_; chop($line); next if ($line =~ /!/); my @splits = split (',', $line); my $first_line = $splits; print "$first_line\n"; }
I am trying to get the string "1424621700" assigned to "$first_line" and then printed. Sorry about the disorganization. I'm new to Perl and haven't quite gotten the hang of it yet.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How do I select first string of a two dimensional array to compare to other values?
by AnomalousMonk (Archbishop) on Aug 31, 2015 at 01:11 UTC | |
by joi1369 (Initiate) on Aug 31, 2015 at 01:19 UTC | |
by AnomalousMonk (Archbishop) on Aug 31, 2015 at 01:49 UTC | |
by AnomalousMonk (Archbishop) on Aug 31, 2015 at 01:30 UTC |