Recently, Somebody Somewhere wrote these words

 (Compile errors snipped)
> 
> Well, you COULD...  ;)  With C, though, you have to use argv and argc.
> :) Let's change it to do something like what you wanted:
> 
> Change the first part to look like this instead:
> 
> #include <stdio.h> #include <ctype.h>
[SNIP] 
> ----------------------------
> 
> That way, you can specify the input filename and the output filename.
> ;) Looks like Declan's gonna be learning himself some C here.  :D

I'd learn just about anything right at the moment to get me sorted.
Thanks again!
That's great - my windoze kiddie and I made it through.... you hadn't
defined 'gottawrap' and you had an insufficient number of arguments to
the  'ungetc' command near the end.  I took it you were ungetting the
input (fp1), and because he had no ideas at all, he agreed with me :).

I'm even forgiving the obtuse info pages for their existence because 
they have pages on useful things like fopen & ungetc.

The output (as viewed through openoffice with the page formatted as
landscape for 145 characters) was 

-(30 chars)-
s
                                Data to end
- ninety spaces -               
                                Data to end
Short line again
                                Data to end
- ninety spaces in tabs-  

etc. The longest line is 2595 characters, btw. So the folding end of the
thing is perfect. But the character count is wrong. Also, a line looks
like this

080510101080    <F5>- - - -<T1>Of high quality <S1>(PN001)<S2>  0805 10
10 10   kg      Cond ( - 31/03 ) <S1>(PB001)<S2>Cond ( 01/04 - 30/04 )
<S1>(PB001)<S2>Cond ( 01/05 - 15/05 ) <S1>(PB001)<S2>Cond ( 16/05 -
31/05 ) <S1>(PB001)<S2>3.2 ( 01/06 - 15/10 ) <S1>(PB001)<S2>16 ( 16/10 -
30/11 ) <S1>(PB001)<S2>Cond ( 01/12 - ) <S1>(PB001)<S2>; Q:10 ( 01/02 -
30/04 ) <S1>(PB001)(CD189)<S2>  EG-QP:Cond ( 16/05 - 31/05 )
<S1>(CD195)(PB001)<S2>; MA-QP:Cond ( 16/05 - 31/05 )
<S1>(CD254)(PB001)<S2>; EG-QP:Cond ( 01/12 - ) <S1>(CD195)(PB001)<S2>;
MA-QP:Cond ( 01/12 - ) <S1>(CD254)(PB001)<S2>; CY, EG, IL,
MA, TN-QP:Cond ( 01/12 - ) <S1>(PB001)<S2>; EG-QP:Cond ( 01/05 - 15/05 )
<S1>(CD195)(PB001)<S2>; MA-QP:Cond ( 01/05 - 15/05 )
<S1>(CD254)(PB001)<S2>; EG-QP:Cond ( 01/04 - 30/04 )
<S1>(CD195)(PB001)<S2>; MA-QP:Cond ( 01/04 - 30/04 )
<S1>(CD254)(PB001)<S2>; CY, EG, IL, MA, TN-QP:Cond ( - 31/05 )
<S1>(PB001)<S2>; EG-QP:Cond ( - 31/03 ) <S1>(PB001)(CD195)<S2>;
MA-QP:Cond ( - 31/03 ) <S1>(PB001)(CD254)<S2>; EG, IL-QP:0 ( 01/07 -
30/11 ) <S1>(PB001)<S2>; MA, TN-QP:0 ( 01/06 - 30/11 ) <S1>(PB001)<S2>;
EG, IL-QP:0 ( 01/06 - 30/06 ) <S1>(PB001)<S2>; CY, EG, HU, IL, LB, MA,
MT, TN, TR:Cond ( 16/05 - 31/05 ) <S1>(PB001)<S2>; PS:Cond ( 16/05 -
31/05 ) <S1>(PB001)(TM066)<S2>; LOMA:Cond ( 16/05 - 31/05 )
<S1>(TM066)(PB001)<S2>; LOMA:Cond ( 15/05 - 15/05 )
<S1>(PB001)(TM066)<S2>; CY, EG, HU, IL, JO, LB,
LOMA, MGB, MT, TR:Cond ( 01/12 - ) <S1>(PB001)<S2>; PS:Cond ( 01/12 - )
<S1>(PB001)(TM066)<S2>; CY,
EG, HU, IL, LB, MA, MT, TN, TR:Cond ( 01/05 - 15/05 ) <S1>(PB001)<S2>;
PS:Cond ( 01/05 - 15/05 ) <S1>(TM066)(PB001)<S2>; LOMA:Cond ( 01/05 -
14/05 ) <S1>(PB001)<S2>; CY, EG, HU, IL, LB, LOMA, MA, MT,
TN, TR:Cond ( 01/04 - 30/04 ) <S1>(PB001)<S2>; PS:Cond ( 01/04 - 30/04 )
<S1>(PB001)(TM066)<S2>; DZ, JO:Cond ( - 31/05 ) <S1>(PB001)<S2>; CY, EG,
HU, IL, LB, LOMA, MA, MT, TN, TR:Cond ( - 31/03 ) <S1>(PB001)<S2>;
PS:Cond ( - 31/03 ) <S1>(PB001)(TM066)<S2>; EG, IL, LB:6.4 ( 16/10 -
30/11 ) <S1>(PB001)<S2>; LOMA, MA, TN:3.2 ( 16/10 - 30/11 )
<S1>(PB001)<S2>; EG, IL, LB:1.2 ( 01/06 - 15/10 ) <S1>(PB001)<S2>;
LOMA:0.6 ( 01/10 - 15/10 ) <S1>(PB001)<S2>; MA, TN:0.6 ( 01/06 - 15/10 )
<S1>(PB001)<S2>; HU:0 ( 16/10 - 30/11 ) <S1>(PB001)<S2>; HR, MK:0 (
01/12 - ) <S1>(PB001)<S2>; CY, DZ, HR, JO, MK, MT, TR:0 ( 01/06 - 30/11
) <S1>(PB001)<S2>; PS:0 ( 01/06 - 30/11 ) <S1>(PB001)(TM066)<S2>; LOMA:0
( 01/06 - 30/09 ) <S1>(PB001)(TM066)<S2>; HU:0 ( 01/06 - 15/10 )
<S1>(PB001)<S2>; HR, MK:0 ( - 31/05 ) <S1>(PB001)<S2>; ABH, GSPL:0; AD,
LOMB, SM:0 <S1>(PB001)<S2>      REEX; PROHI: IQ; PROHI-EX: IQ
<S1>(TM490)<S2>

And it's all tab delimited. 
I'm got to figure some trick to keep the tabs in the first 145
characters, as the columns are important. As you view the above, Line 2
has 'kg near' the beginning; Next entry is it's own comuln, and the rest
need folding and indenting. Sed is my friend at this stage for removing
all those <S1> things. Life is funny, isn't it?


> 
> 
> Also...
> 
> 
> > That's great. I need 90 - yes, about 90. Is that
> >
> >     fputs("\n\t\t\t\t\t\t\t\t\t\t\t\t", fp2); fputs("\n\t{11}",
> >     fp2);
> 
> What I'd recommend there is something similar...  The \t are tabs, of
> course, and you're just outputting them to the screen...  So you're
> outputting a newline, 12 tabs, then another newline, and then the
> string {11}...  I don't think that's what you're intending.  :)  I'm
> not quite sure what you're intending, but "puts" is a VERY simple
> function...  It simply puts whatever is in there to the output stream
> (fp2, the second file pointer, in this case).  You're probably looking
> for something more like printf, which allows you to output all sorts
> of stuff in a nicely formatted manner...


That was meant to be either fputs("\n\t\t\t\t\t\t\t\t\t\t\t\t", fp2); OR
fputs("\n\t{11}", not actually both
--

        With Best Regards,


        Declan Moriarty.
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to