Win has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I’m having problems figuring out what I am doing wrong here.
I am using a flat file like so:
>(Request_id - unique for component number) SPROC Name: make_geo_mortality_count_C_test *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;1;Standardisation;'EuropeanSta +ndard' *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;2;Disease_cat;COPD *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;3;Sex;2 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;4;Sex_code;MF *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;5;Constraint_ref;1 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;6;ICD_start_9;A490 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;7;ICD_end_9;A492 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;8;ICD_start_10;J400 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;9;ICD_end_10;J449 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;10;ICD_start_9_B;A496 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;11;ICD_end_9_B;A496 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;12;ICD_start_10_B;J400 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;13;ICD_end_10_B;J449 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;14;ICD_start_9_C;A496 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;15;ICD_end_9_C;A496 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;16;ICD_start_10_C;J400 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;17;ICD_end_10_C;J449 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;18;Yearfrom;1998 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;19;Yearto;2002 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;20;Min_age;0 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;21;Max_age;74 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;22;Region;Community *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;23;Instance_name;Place_A *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;24;Geo_scope;Town *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;25;Number_of_years;5 *gzQkDyUoIKtQXPbXQgRRlgjopGabmhHaxoDO;1;26;Unique_identifier;'gzQkDyUo +IKtQXPbXQgRRlgjopGabmhHaxoDO' *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;1;Standardisation;'EuropeanSta +ndard' *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;2;Disease_cat;COPD *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;3;Sex;2 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;4;Sex_code;MF *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;5;Constraint_ref;1 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;6;ICD_start_9;A490 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;7;ICD_end_9;A492 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;8;ICD_start_10;J400 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;9;ICD_end_10;J449 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;10;ICD_start_9_B;A496 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;11;ICD_end_9_B;A496 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;12;ICD_start_10_B;J400 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;13;ICD_end_10_B;J449 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;14;ICD_start_9_C;A496 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;15;ICD_end_9_C;A496 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;16;ICD_start_10_C;J400 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;17;ICD_end_10_C;J449 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;18;Yearfrom;1998 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;19;Yearto;2002 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;20;Min_age;0 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;21;Max_age;74 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;22;Region;Community *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;23;Instance_name;Place_B *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;24;Geo_scope;Town *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;25;Number_of_years;5 *JdwTXlGGdgGHsdABgvFqXuwSnZEchiybqBqC;2;26;Unique_identifier;'JdwTXlGG +dgGHsdABgvFqXuwSnZEchiybqBqC' *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;1;Standardisation;'EuropeanSta +ndard' *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;2;Disease_cat;COPD *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;3;Sex;2 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;4;Sex_code;MF *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;5;Constraint_ref;1 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;6;ICD_start_9;A490 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;7;ICD_end_9;A492 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;8;ICD_start_10;J400 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;9;ICD_end_10;J449 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;10;ICD_start_9_B;A496 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;11;ICD_end_9_B;A496 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;12;ICD_start_10_B;J400 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;13;ICD_end_10_B;J449 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;14;ICD_start_9_C;A496 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;15;ICD_end_9_C;A496 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;16;ICD_start_10_C;J400 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;17;ICD_end_10_C;J449 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;18;Yearfrom;1998 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;19;Yearto;2002 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;20;Min_age;0 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;21;Max_age;74 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;22;Region;Community *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;23;Instance_name;Place_C *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;24;Geo_scope;Town *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;25;Number_of_years;5 *tYeTCkrrkDGrudrBcYFHWZisnqvvGiTCgAQs;3;26;Unique_identifier;'tYeTCkrr +kDGrudrBcYFHWZisnqvvGiTCgAQs' END
I am reading the flat file with the following Perl program. If the flat file only has one component in it the program works fine. If the there is greater than one component it does not work for the 2nd, 3rd, etc components.
#! perl -w scipt use strict; use warnings; use DBI; use DBD::ODBC; use File::Copy; my ($data_source, $database, $user_id, $password) = qw( *********** ** +****** ******** ********); my $conn_string = "driver={SQL Server}; Server=$data_source; Database= +$database; Trusted_Connection=yes"; my $dbh = DBI->connect( "DBI:ODBC:$conn_string" ) or die $DBI::errstr; my $Request_id; my $Variable_number; my $Variable; my $Choice; my @VARIABLE; my @CHOICE; my $Command; my $Return_results; my $Component_number_old = 1; my $Component_number = 1; my $SPROC; my $unique; my $flat_file = "Flat_file.txt"; open (FLAT_FILE, "<$flat_file"); while (<FLAT_FILE>){ chomp; print "look at me\n"; $Component_number_old = $Component_number; # undef $Component_number; if ($_ =~ /SPROC\sName\:\s([a-z|A-Z|0-9|_]{1,100})/){ print "Hi_A\n"; $SPROC = $1; } elsif ($_ =~ /^\*(.{36})\;(\d{1,5})\;(\d{1,5})\;([a-z|A-Z|0-9|_]{1,5 +0})\;(.{1,100})/){ print "$_\n"; push (@VARIABLE, $Variable); push (@CHOICE, $Choice); print "Hi_B\n"; $unique = $1; $Component_number = $2; $Variable = $4; $Choice = $5; } if ($_ =~ /^\sEND/){ print "Hi_E\n"; push (@VARIABLE, $Variable); push (@CHOICE, $Choice); # $Command = join(' ', # 'EXEC', # $SPROC, # join(', ', # @CHOICE[1 .. $Component_number_old])) . ';'; $Command = "EXEC ".$SPROC." ".$CHOICE[1].", ".$CHOICE[2].", ".$C +HOICE[3].", ".$CHOICE[4].", ".$CHOICE[5].", ".$CHOICE[6].", ".$CHOICE +[7].", ".$CHOICE[8].", ".$CHOICE[9].", ".$CHOICE[10].", ".$CHOICE[11] +.", ".$CHOICE[12].", ".$CHOICE[13].", ".$CHOICE[14].", ".$CHOICE[15]. +", ".$CHOICE[16].", ".$CHOICE[17].", ".$CHOICE[18].", ".$CHOICE[19]." +, ".$CHOICE[20].", ".$CHOICE[21].", ".$CHOICE[22].", ".$CHOICE[23].", + ".$CHOICE[24].", ".$CHOICE[25].", ".$CHOICE[26].";"; my $Request_id = $CHOICE[26]; print "$Command\n"; Got_Command($Command, $Request_id); # exit; undef @CHOICE; my @CHOICE; } if ($Component_number_old != $Component_number){ print "Hi_D\n"; push (@VARIABLE, $Variable); push (@CHOICE, $Choice); # $Command = join(' ', # 'EXEC', # $SPROC, # join(', ', # @CHOICE[1 .. $Component_number_old])) . ';'; if ($Component_number > 1){ my $a = 1+($Component_number*26); my $b = 2+($Component_number*26); my $c = 3+($Component_number*26); my $d = 4+($Component_number*26); my $e = 5+($Component_number*26); my $f = 6+($Component_number*26); my $g = 7+($Component_number*26); my $h = 8+($Component_number*26); my $i = 9+($Component_number*26); my $j = 10+($Component_number*26); my $k = 11+($Component_number*26); my $l = 12+($Component_number*26); my $m = 13+($Component_number*26); my $n = 14+($Component_number*26); my $o = 15+($Component_number*26); my $p = 16+($Component_number*26); my $q = 17+($Component_number*26); my $r = 18+($Component_number*26); my $s = 19+($Component_number*26); my $t = 20+($Component_number*26); my $u = 21+($Component_number*26); my $v = 22+($Component_number*26); my $w = 23+($Component_number*26); my $x = 24+($Component_number*26); my $y = 25+($Component_number*26); my $z = 26+($Component_number*26); $Command = "EXEC ".$SPROC." ".$CHOICE[1].", ".$CHOICE[2].", ".$CHO +ICE[3].", ".$CHOICE[4].", ".$CHOICE[5].", ".$CHOICE[6].", ".$CHOICE[7 +].", ".$CHOICE[8].", ".$CHOICE[9].", ".$CHOICE[10].", ".$CHOICE[11]." +, ".$CHOICE[12].", ".$CHOICE[13].", ".$CHOICE[14].", ".$CHOICE[15].", + ".$CHOICE[16].", ".$CHOICE[17].", ".$CHOICE[18].", ".$CHOICE[19].", +".$CHOICE[20].", ".$CHOICE[21].", ".$CHOICE[22].", ".$CHOICE[23].", " +.$CHOICE[24].", ".$CHOICE[25].", ".$CHOICE[26].";"; # $Command = "EXEC ".$SPROC." ".$CHOICE[$a].", ".$CHOICE[$b].", ".$ +CHOICE[$c].", ".$CHOICE[$d].", ".$CHOICE[$e].", ".$CHOICE[$f].", ".$C +HOICE[$g].", ".$CHOICE[$h].", ".$CHOICE[$i].", ".$CHOICE[$j].", ".$CH +OICE[$k].", ".$CHOICE[$l].", ".$CHOICE[$m].", ".$CHOICE[$n].", ".$CHO +ICE[$o].", ".$CHOICE[$p].", ".$CHOICE[$q].", ".$CHOICE[$r]." , ".$CHO +ICE[$s].", ".$CHOICE[$t].", ".$CHOICE[$u].", ".$CHOICE[$v].", ".$CHOI +CE[$w].", ".$CHOICE[$x].", ".$CHOICE[$y].", ".$CHOICE[$z].";"; } else{ $Command = "EXEC ".$SPROC." ".$CHOICE[1].", ".$CHOICE[2].", ".$CHO +ICE[3].", ".$CHOICE[4].", ".$CHOICE[5].", ".$CHOICE[6].", ".$CHOICE[7 +].", ".$CHOICE[8].", ".$CHOICE[9].", ".$CHOICE[10].", ".$CHOICE[11]." +, ".$CHOICE[12].", ".$CHOICE[13].", ".$CHOICE[14].", ".$CHOICE[15].", + ".$CHOICE[16].", ".$CHOICE[17].", ".$CHOICE[18].", ".$CHOICE[19].", +".$CHOICE[20].", ".$CHOICE[21].", ".$CHOICE[22].", ".$CHOICE[23].", " +.$CHOICE[24].", ".$CHOICE[25].", ".$CHOICE[26].";"; } my $Request_id = $CHOICE[26]; print "$Command\n"; Got_Command($Command, $Request_id); # undef @CHOICE; # my @CHOICE; print "@CHOICE"; # exit; push (@VARIABLE, $Variable); push (@CHOICE, $Choice); # $VARIABLE[0] = $Variable; # $CHOICE[0] = $Choice; } } close FLAT_FILE; my $source = $flat_file; my $dest = 'Bin'; move($source, $dest) or die "Error moving file: $!\n"; sub Got_Command { my($Command,$Request_id) = @_; print "Hi_F\n"; print "here\n"; my $output_file = "Output/Output_file_".$Request_id.".txt"; open (OUTPUT_FILE, "+>>$output_file"); # Pass parameters to a stored procedure stored procedure print "$Command\n"; my $sthB_A = $dbh->prepare($Command) or die "Couldn't prepare query +: ".$dbh->errstr; $sthB_A->execute() or die "Couldn't execute query: ".$sthB_A->errstr +; my $Return_results = "Select * from Result_storage_keep where Unique +_identifier = ".$Request_id."\;"; print "$Return_results\n"; my $sth = $dbh->prepare($Return_results) or die "Couldn't prepare qu +ery: ".$dbh->errstr; $sth->execute() or die "Couldn't execute query: ".$sth->errstr; # my @row; while (my @row = $sth->fetchrow_array ) { print OUTPUT_FILE join("\t", @row); print OUTPUT_FILE "\n"; } }
Any suggestions as to the best way to handle this flat file?

Replies are listed 'Best First'.
Re: Flat file handling
by revdiablo (Prior) on Nov 18, 2004 at 18:52 UTC
    use Mode::Rant;

    This question appears to lack any effort whatsoever. You've simply pasted your data file, and pasted your entire script, with a few lines of explanation in between. You haven't explained what you did to narrow down the problem, what the problematic behavior is ("does not work" is not very helpful), or even taken a wild guess at what could be wrong.

    Based on this, it seems to me that you want the Perl Monks to do your work for you. I know this happens often. There are plenty of Monks who are so bored, or so willing to show off, that they'll do a lot of free work for someone. Heck, I'm guilty of it myself. But I think it would be in your best interest to put forth some effort of your own. You will find the responses are quicker, better, and might actually lead you to solve your own problem (rather than waiting for someone to solve it for you).

    I have a feeling you will ignore this reply, but I hope you don't. Nothing would make me happier than to see you solve your own problem. Then perhaps you would begin to help others at the Monastery in return. Thus the entire community would grow stronger. I am sorry to say that I doubt it will happen, but it would be a happy turn of events if it did.

Re: Flat file handling
by davido (Cardinal) on Nov 18, 2004 at 17:33 UTC

    I thought someone mentioned this yesterday, but the following:

    $Command = "EXEC ".$SPROC." ".$CHOICE[1].", " . $CHOICE[2].", ".$CHOICE[3].", " . $CHOICE[4].", ".$CHOICE[5].", " . $CHOICE[6].", ".$CHOICE[7].", " . $CHOICE[8].", ".$CHOICE[9].", " . $CHOICE[10].", ".$CHOICE[11].", " . $CHOICE[12].", ".$CHOICE[13].", " . $CHOICE[14].", ".$CHOICE[15].", " . $CHOICE[16].", ".$CHOICE[17].", " . $CHOICE[18].", ".$CHOICE[19].", " . $CHOICE[20].", ".$CHOICE[21].", " . $CHOICE[22].", ".$CHOICE[23].", " .$CHOICE[24].", ".$CHOICE[25].", " .$CHOICE[26].";";

    (What a mess) ...can be replaced by any of a number of clearer idioms, including:

    $command = "EXEC $SPROC " . join( ', ', @CHOICE[ 1 .. 26 ] ) . ';';

    Isn't that nicer? By the way, where's $CHOICE[0]?


    Dave

      Or even better.... something like:
      my $xx = $Variable+($Component_number*$Variable); $Command = join(' ', 'EXEC', $SPROC, join(', ', @CHOICE[1 .. $xx]).';';
      This gives me an error though.
      syntax error at 20_October_2004_H.pl line 143, near "';';" Execution of 20_October_2004_H.pl aborted due to compilation errors.
      I ended up not including $CHOICE[0] due to trial and error. Not sure why ... as you say ... it is a mess.

        You've got to clean it up a bit before it'll begin to make sense. Consider using a uniform practice of indentation. That will help in lining up brackets and parens, etc.

        Also, that whole schpiel where you've got

        my $a.... my $b.... my $c....

        ...and so on... that's not doing anything for you. You're declaring those variables within a narrow lexical scope, and they're passing out of scope before you ever use them. That's pointless. And even if it were, shouldn't that be an array of 26 elements rather than 26 named variables? ...and maybe a loop? Anytime you find yourself writing something 26 times, it's time to use a loop.

        And even then, shouldn't those variable names have some meaning so a casual reader will know what they're for? The fact that they don't have meaningful names is probably why they've ended up not getting used anywhere else.

        As for why your followup snippet doesn't work, it's missing a closing paren, which you could identify more easily if you were to adopt a uniform indentation practice.

        Just some tips. I have no idea what the actual bug is, but there are underlying clarity problems that contribute to making it difficult for this piece of code to be developed, maintained, and understood.


        Dave

Re: Flat file handling
by trammell (Priest) on Nov 18, 2004 at 17:44 UTC
    One important thing your code (and your node) is missing is a comment explaining exactly what it is you're trying to do.

    In my experience, not being able to succinctly explain one's goal is a strong indicator that the perceived goal is ill-defined.

      The goals of the program are to

      1. Read in the flat file
      2. Take the name of the stored procedure from the flat file.
      3. Prepare the first execute statement by reading the flat file line by line. Each EXEC statement input variable is defined line by line in the flat file.
      4. When either there is a change in the unique identifier (ie. there is a new component), or the END of the file is reached, the EXEC is fired and the next EXEC statement build is begun.
      5. The EXEC statement/s are fired in turn and the results returned to a output file.
        Okay, this is progress in the right direction -- much better than the initial post in this thread, which is too much of a mess (too many things wrong with it) to look for any specific problem. My recommendation is to delete the original script, and start a new one, which opens with comment lines that reflect your 5-point synopsis. Then write code in accordance with the comments.

        Of course, the 5-point summary still needs a little work...

        1. Read in the flat file
        Fine. But it would be helpful to describe (briefly and succinctly) what information is actually present in the file, or at least, what information in it is needed by your script, and how it's formatted. (For example, the OP talks about "components" in the file, but there's no indication about what constitutes one "component".)
        2. Take the name of the stored procedure from the flat file.
        Good. How do you do that? Is there more than one procedure name in the file? If so, how will you keep track of them all (or do you only need the first or last one that you find)?
        3. Prepare the first execute statement by reading the flat file line by line. Each EXEC statement input variable is defined line by line in the flat file.
        This is not clear. You've already read the file. (Or did steps 1 and 2 just involve reading the first line or few, rather than reading the entire file? You need to be clear about that.) As with the procedure name thing in step 2, how is the input variable determined from the content of each line? You mention "first execute statement", so how many such statements will there be? (Determined by number of lines in the file? Number of lines of a particular format?) Are you talking about really different statements, or a single statement with a placeholder, to be used with the variable that is read from each line?
        4. When either there is a change in the unique identifier (ie. there is a new component), or the END of the file is reached, the EXEC is fired and the next EXEC statement build is begun.
        Here we go with "components" again. What the heck is a "component"?? If you've read the file and built up the exec statement and now you execute it, where does the "next EXEC statement" come from? Or have you still not read the entire file yet?
        5. The EXEC statement/s are fired in turn and the results returned to a output file.
        There needs to be enough information in the commentary about the input file so that the code reader (and the code writer!) can look at the input data file and identify key events that will invoke specific behaviors within the script.

        Your description seems to indicate a sort of hierarchical structure in the data: a procedure, a set of values to pass to that procedure, another procedure, another set of values, and so on. If this is so, and if the commentary (i.e. internal documentation) describes this clearly, and if the code is written so that it conforms to the commentary, then things will work better all around. Especially the next time you paste your whole script at the start of another SoPW thread.

        And for cryin' out loud, if you're going to ask for advice, you should try using the advice you're given -- and even try a few more things on your own after that -- before asking for more advice. (I usually don't downvote SoPW nodes, but I made an exception in your case because you really have shown a lack of consideration in this regard.)

        Oh, and do try to use consistent indentation. It really does help (you and us both). If your text editing tool supports auto-indentation, learn how it works; if not, set yourself a goal to acquire one that does and learn to use that.