raj000 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, I am trying to format the record that i am writing out to the file. The length of the name is different for every record. In this case how can i position DOB at fixed position. basically i am trying to repeat the variable number of blanks between name and DOB to position DOB at the same location for every record. The code i have:
$name_length = length($std_name); $blank = " "; printf($std_name. "%$name_length $blank".$dob."%10c $blank".$age. "\n" +";
My output should be in the following format:
Thanks in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: formating the record
by ikegami (Patriarch) on Oct 07, 2011 at 17:48 UTC | |
|
Re: formatting the record
by roboticus (Chancellor) on Oct 07, 2011 at 18:22 UTC | |
|
Re: formating the record
by choroba (Cardinal) on Oct 07, 2011 at 20:29 UTC | |
|
Re: formating the record
by Not_a_Number (Prior) on Oct 07, 2011 at 18:56 UTC | |
by Perlbotics (Archbishop) on Oct 08, 2011 at 22:17 UTC |