Re: Whoto remove line feed control character from report output
Posted in 2006
Franz Grutzmacher wrote: > Hi All > > Hope someone can help me with this little pain. > I am creating a output flat file for a 3rd party company. The file is > fix length 80columns. > After sending the file to the 3rd party I was informed that there is a > line feed character at position 81. > > Only when viewing the file in TextPad did I manage to see the special > character. In the vi editor I can't see the LF character. > > Now how do I remove this character from each line of the file. Can the > 4gl report do this for me? > OS= SCO Are they complaining that the file includes the newline/carriage return combo common to DOS & Windoze or that the records are actually 81 bytes including the newline only and they expect non-delimited 80 byte records? Here's a little 'C' program to remove the newlines and output pure fixed length binary records. It's a standard UNIX filter so run as: nonl <infile >outfile ################# break here ################################### /* nonl.c - strip newlines from a text file. */ #include <stdio.h> #include <stdlib.h> char RCSHeader[] = "$Header: nonl.c,v 1.2 93/07/14 19:41:37 kagel Exp $", ECSId[] = "$Id: nonl.c,v 1.1 1993/07/14 19:37:12 kagel Exp kagel $"; int main() { int ch; while( (ch = fgetc( stdin )) != EOF) if (ch != '\\n') fputc( ch, stdout ); }