Re: file output, columns, etc...
| From: | CPT John W. Holmes | Date: | Wed, 04 Jun 2003 15:00:00 +0000 |
| Subject: | Re: file output, columns, etc... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-150185@lists.php.net to get a copy of this message | ||
> Need some help here. I have to format a line with each piece of the line
> being a fixed set of characters in length, wether its a mix of spaces and
> letters, or all letters. Here's an example of the line:
>
> 06?4111111111111111ABDALAR M333 N COUNTRY CLUB CANTON
DD88888
>
> In this file, for instance, CANTON's space on the line has a length of 13
> characters. If 'CANTON' is not 13, I have to fill with spaces. Is there
> some sort of report formatting functions or osmething I can look at to lay
> out the structure of the line and then drop in variables to it and have
the
> line format itself w/o me having to calculate the length of each variable
> and put spaces at the end accordingly? I've tried search, but I don't
have
> a clue what I am really looking for. Help is appreciate.
printf() or sprintf() should do what you want...
---John Holmes...