I am trying to write to a file from Perl. I just want to write the data in tab delimited format. However, the data that I am writing has varying lengths and is not lining up.
For example I am trying to write something like this:
Name Education Fav_Car MoneyInBank
josh High School Porche 500
SomeOtherName PHD Hyundai 50000
I just want the data to be lined up with the headers that I have on top.
I am outputting the data like so:
printf FILE ("%s%20s%20s\n", "Name", "Ed", "Car");
while (($name, $ed, $car) = $sth->fetchrow_array) {
printf FILE ("%s>>>>>>>>>>>>>%40s%40s\n", $name, $ed, $car);
};