Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Line feeds

Status
Not open for further replies.

LYEDI

Technical User
Oct 12, 2004
5
US
Hello,

WE are using Red Hat Linux 9 for our Interactive Agent implementation. We are currently using EDI release 4010 of X12 standard for communication to Bellsouth. We have established well known connectivity and processed many orders 10K+ but now are being told for there interactive agent that we have to remove the line feed at the End of the file although it is there for our Firm Order processing via our NDM. How can we remove this since are EDI doc's are created in a text editor.

Thanks,
LYEDI
 

Is the line feed only at the end of the file or are the multiples in the file (end of each line)?
 
Only at the end according to Bellsouth. Funny thing is that SBC has no problem with this and neither does bellsouth when the orders are sent thru the NDM. Only when we send our interactive agent files are we having this issue. Bellsouth of course will not admit that they have an issue.
 

In the data is there multiple files that are appened together. Is it possible post a small sample of the data, last couple of lines ( SE --> IEA) that they are claiming to be the issue?

If sending multiple files, if you just send one does this get processed with no issues.
 
Open the file in a good editor, checking it in hex to see if there is a 0D0A, then delete it and save. Could be that BellSouth is getting a warning from the EDI tool.



BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
There is a command line utility called "swap.exe" that can remove the line feeds. We use it to remove CRLF. Well, this small util will do a lot more. I suggest you use it becuase you can implement it into your process.
 
swap.exe where would that be located and how do I use it.
 
I got mine through the eVision package from Tie Commerce. I searched the web and found a bunch of swap.exe, but DO NOT use them becuase the decription were not clear.

I don't know how to send or attach files in this forum. If you can figure that out, tell me and I can send you a copy.

The license for swap.exe states that it "is a non-published freeware utility by Tie Commerce" so it is okay for me to give to you. (I think.)

Note that swap.exe is Windows and not Linux. Perhaps you can work something out.

I ran the help and got the below information. If you can use it, respond and we can figure out something so I can get the util to you.

**********************************
Usage:
swap /pXX[,XX...] {/rXX[,XX...]} ([<file_name> ...]] | -)

<file_name> = Filename to swap patterns on.
(Caution- pattern replacement is not reversible.
Make sure that you really want them changed.)

More than one filename may be specified. If no filename is given, or if the filename is a hyphen (-), swap reads input from the keyboard.)

/p = Pattern to search for. The default character is
^Z(Hex 1A).
/r = Optional replacement string. Every instance of
pattern /p will be replaced by this string.
If not specified, the net effect is to remove all
occurences of /p from <file_name>

NOTE: Characters must be in comma-separated hex notation.

Examples:
Remove all ^Z from file DATRAN.DAT:
swap datran.dat /p1a

Change all tabs to ``X''s in TEMP.DAT:
swap temp.dat /p9 /r58

Change all ``BCD''s to ``bcd''s in ALPHA.DAT:
swap alpha.dat /p42,43,44 /r62,63,64

Swap is a non-published freeware utility by TIE Commerce
No warranty is either expressed or implied.
**********************************
 
I forgot to tell you my usage...

Since this is a command line exe, I create a batch file accepting 1 parameter for filename.

In the batch, I have the command:
copy %1 %1.bak
swap %1 /p0D,0A

Then in my application, I call the batch passing the filename.

Hope this helps.
 
Way too much effort. Since there is one extra line feed at the end of the file only, and the file is created in a text editor in the first place, you should be able to backspace up to the last character and save the file. If someone else is creating the file and can't manage to do this, and since you are running on LINUX which has all the UNIX text manipulation programs, you should be able to get your sys admin to write a simple script that checks for the last byte of the file and delete it if it is not what you want.
On Windows you need special programs etc. since it is not an enterprise OS, yet (IMHO).



BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Boca
That is fine and is what I am doing but it is not fool proof it seems that I have to put a carriage return in and then backspace in insert mode to clear it out. Once we put this out on the web we cannot have anymore manual intervention since we will need realtime. I have asked our System Admin but he was unsure as well.
 
What EDI software do you use? You should be able to produce a valid ANSI X12 doc with no extra bytes.



BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Well, it was a lot of effort for me initially. But I don't find it to be an issue anymore.

For what Lyedi is doing and achieve automation, a script or some kind needs to look at the file.

I found this on the web and it might help you. You can read it or just jump to the bottom.

Tutorials & FAQ: CGI: UNIX/WIndows Text File Compatability
 
Well for EDI Order Processing we do not have this problem. It is only on the Linux machine that we have it and it is for Pre order only. The software that we are using for Interactive Agent is still in test with two companies one is Lymeware and the other is Xintex. But no matter which one I use bellsouth says I have the carriage return in the doc. They are the only ones that care about it becasue SBC never has said anything nor do they see it there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top