Hi All,

I have a small project that is stumping me aside from using a straight brute 
force.

I am processing output from an accounting program that is producing some 
sort of printer control for some 3rd party print processing.   I have 
several partial lines that have commands to "over write" the line to create 
bold type.    I need combine the lines:

1            Balance Due:
0            Balance Due:            $567.23
0                                    $567.23       Before Due Date:
0                                                  Before Due Date:   06/15/12
0                                                                     06/15/12

So the output line should be:

             Balance Due:            $567.23        Before Due Date: 06/15/12


The problem is the lines can be variable so I cannot just use substr to copy 
parts of lines.   The brute force was I was going to use is to just create 
an output array for the line and loop through each line position by position 
and if the character was not a space, set that position in the output array 
to the character in the input line.

Any suggestions for a more elegant solution?

Thanks
Paul

 

Reply via email to