How about a little data? Not all the data, just enough to demonstrate the problem. You should also show us a sample of what you get and what you expect for the sample data.
At present I can't tell if there should be data for 40 buildings, but you are only seeing output data for 11, or if the problem is that there are 40 columns in the input and only 11 in the output. Although you describe your output file as CSV, it's not using the same format as the original file and doesn't conform to the usual expectations for a CSV file - it may be better thought of as a text or data file to avoid confusion.
As an aside, don't globally declare local variables - all your temporary variables should be declared where they are initialized (inside the loop or sub). Use the three parameter version of open and use a lexical variable (my $myFile) instead MYFILE (good to see the open is checked though).
Also, use a while loop rather than a for loop for reading input lines.
In reply to Re: Printing of Array Hash is Missing Elements
by GrandFather
in thread Printing of Array Hash is Missing Elements
by spickles
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |