in reply to For Loop Output Errors

I also do not really understand your requirement and also not the relation between such requirement and your code.

A few comments on your code, though.

for ($i = 0; $i < @tablea; $i++) {
It would be more perlish, clearer and probably faster (although this probably does not matter much) to write:
for my $i (0..$#tablea) {
or, better yet, to drop altogether the $i counter and get directly the content of the line:
for my $line(@tablea) {
Please consult http://perldoc.perl.org/perlsyn.html#Compound-Statements for more information.

Counting the lines of a file:

system("wc $mcpFile > crap"); open(TABLEB,'crap'); @tableb = <TABLEB>; chomp ($tableb[0]); ($count) = (split /\s+/,$tableb[0])[1]; $numObs = $count - 9; close(TABLEB); unlink('crap');
This is probably the most contrived and unnatural way of counting the lines of a file that I have ever seen. Why don't you open the file and just count the lines? Something like this:
my $count = 0; open my $IN, "<", $mcpFile or die "unable to open $mcpFile $!"; $count++ while <$IN>; close $IN;
Well, actually, I made an explicit counter for the sake of clarity, but you don't even need the $count variable here, since Perl is maintaining a line counter for you in the $. special variable (see perlvar).

If you really want to use a system call, still don't use this crap file:

my $wc_output = `wc -l $mcpFile`;
Also observe the good practice way to open a file, with a three-argument syntax and a lexical file handle. Check open for more information.
$numLines = int($numObs/6); $remainder = $numObs - ($numLines*6);
There is a modulo operator in Perl (check perlop, especially http://perldoc.perl.org/perlop.html#Multiplicative-Operators:
my $remainder = $numObs % 6;
You are now opening the file whose lines you just counted:
open(TABLEB, $mcpFile);
I don't understand the logic of what you are trying to do, but it seems to me that you could probably open it only once. Ditto on the open syntax.
@tableb = <TABLEB>;
Nothing wrong here, but it is usually better to use the while operator to iterate line by line over the file (especially if the file is large):
while (my $line = <TABLEB>) {
which means you don't need the for loop afterwards. Ditto on the more perlish for syntax.
($PDE,$year,$month,$day,$hour,$minute,$second,$eqlat,$eqlong,$eqdepth, +$mag) = (split /\s+/,$tableb[$j])[0,1,2,3,4,5,6,7,8,9,11];
can be written simpler:
my ($PDE,$year,$month,$day,$hour,$minute,$second,$eqlat,$eqlong,$eqdep +th,$mag) = (split /\s+/,$tableb[$j])[0..9,11];
or
my ($PDE,$year,$month,$day,$hour,$minute,$second,$eqlat,$eqlong,$eqdep +th,undef, $mag) = split /\s+/,$tableb[$j];
Then, you are iterating a second time on the array:
for ($k = 0; $k < @tableb; $k++) {
Ditto on the for syntax. But why don't you do everything within the same loop?

Now to the final and probably most important advise. You may have noticed that I used throughout the my operator to declare new lexical variables. This is very important, declare your lexical variables with my. And you should use the

use strict; use warnings;
pragmas at the top of every program having more than one single line. This will enable the compiler to warn you about many of your errors, typos, dangerous or deprecated constructs, etc., and you will end up saving a lot of time.

I hope this helps.

Update, 11:14 UTC:: it appears that I read one of the OP's code lines too quickly and that the OP is not counting the lines, but the words, of the $mcpFile. But that does not really change the underlying idea that I wanted to come across.

Je suis Charlie.