> We have a process that has been working fine but on
> this file our awk print command is having trouble.
> The input file has no new line characters.
> Our commnad:
> cat <input> | awk '{printf("%-200s",$0)}'  > <output>
>
> We expect the input and output to be the same but our
> output has extra spaces at the end causing our
> application to fail.
>
> If we did this:
> cat <input> | awk '{printf("%-80s",$0)} > <output>
> It would work but anything over 80 then our output is
> not the same as our input.
>

If the input data are ANSI EDI, AND this is a Win32 environment, you can 
download my reformatter. That will clean up the input for you: it reformats 
from any ANSI EDI to any ANSI EDI, removes extraneous data (eg spaces at the 
end of segments, communications headers). (For that matter, it might totally 
replace your awk script).

Go to http://www.talsystems.com, hit the "Tech Corner" tab and then download 
the EDICLEAN software.

You cannot get a better value for the price. (Free.)

> Please don't ask why we do this.

Why do you think I wrote this utility? After nearly 25 years working with 
ANSI EDI data, I'd seen enough different formats cause enough applications 
fail because of "unexpected format" that I thought this would be handy. Not 
that the applications SHOULD have failed - IMNSHO good ANSI EDI applications 
should be format-agnostic - but in Real Life this is what does happen.


Michael C. Mattias
Tal Systems Inc.
Racine WI
[EMAIL PROTECTED]



...
Please use the following Message Identifiers as your subject prefix: <SALES>, 
<JOBS>, <LIST>, <TECH>, <MISC>, <EVENT>, <OFF-TOPIC>

Job postings are welcome, but for job postings or requests for work: <JOBS> IS 
REQUIRED in the subject line as a prefix. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/EDI-L/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/EDI-L/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to