Supress extra Carriage returns
Moderators: chulett, rschirm, roy
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
Hey try this code to eliminate the CR characters
Trim(Ereplace(input.Link, Char(13): Char(10) ,"",-1,0))
and change your delimiter to a value that is not expected in your input file stream. the windows character map can be of your help. Its in programs -> Accesories -> system tools. choose something thats nevere gonna come in your input stream.
Guru,
Please point out isssues with my approach if any. I have used this approach in my job.
Trim(Ereplace(input.Link, Char(13): Char(10) ,"",-1,0))
and change your delimiter to a value that is not expected in your input file stream. the windows character map can be of your help. Its in programs -> Accesories -> system tools. choose something thats nevere gonna come in your input stream.
Guru,
Please point out isssues with my approach if any. I have used this approach in my job.
The problem with this derivation is it removes all the CRLF characters in a string. Which inturn, converts any string with 2 or more lines into a single line which I don't want to happen. I only want to trim those extra CRLF's at the end of the string. Ken's solution worked beautifully. I have already tested it. I was just wondering why Ray's solution didn't work and looking into it.Krazykoolrohit wrote:
Trim(Ereplace(input.Link, Char(13): Char(10) ,"",-1,0))
Kris
Where's the "Any" key?-Homer Simpson
Where's the "Any" key?-Homer Simpson
Hi Krish,
Seems you are retrieve from SQL server and the output data is stored in sequential ie flat file and you are tranfering (via FTP?) to the unix server.
When tranfering (FTP?) set the transfer mode as ASCII, then you won't get the <CR><LF> character.( You can view this by opening the file using vi editor , at the end of each line ^M will be there if the file is transfered using Binary mode).
Hope this may help.
Regards
-NB
Seems you are retrieve from SQL server and the output data is stored in sequential ie flat file and you are tranfering (via FTP?) to the unix server.
When tranfering (FTP?) set the transfer mode as ASCII, then you won't get the <CR><LF> character.( You can view this by opening the file using vi editor , at the end of each line ^M will be there if the file is transfered using Binary mode).
Hope this may help.
Regards
-NB
Folks, the issue is that a text block contains trailing CR/LF that the poster wishs "trimmed". It has nothing to do with anything other than prettying up a column.
As a piece of etiquette, it probably behooves anyone responding to a poster to read every reply, not just the last one. Then, replies will not side-track the discussion. This entire post is a lesson on how not reading the original problem can generate a lot of replies that muddy the waters.
As a piece of etiquette, it probably behooves anyone responding to a poster to read every reply, not just the last one. Then, replies will not side-track the discussion. This entire post is a lesson on how not reading the original problem can generate a lot of replies that muddy the waters.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle