vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 Thanx Franz www.bybelgenootskap.co.za / www.biblesociety.co.za DISCLAIMER: The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. |
| |||
| 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. > Many newer vi editors (vim) doesn't display the line feed character (^M) unless you open the file with '-b' option. I usually remove ^M using vi command ':%s!^M!!g'. ^M is entered as Ctrl+V Ctrl+M > Now how do I remove this character from each line of the file. Can the > 4gl report do this for me? > OS= SCO > |
| |||
| 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 ); } |
| ||||
| 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 ); } |