Skip to main content

Posts

Showing posts with the label char(10)

How to remove Line Breaks from a string using Siebel eScript

In Siebel if you copy the value from field (which have line break character) and paste in notepad it will look fine, but when you use query step in workflow or script and check the logs, the search spec will have a large white space due the line break character stored in data base of that specific column and query will not work. For removing line breaks in a field you can use below eSciprt. Line breaks in strings Windows: \r\n carriage return followed by newline character. Linux: \n just a newline character. Regular Expression: if(MethodName == "Remove LB CR")     {         var vTemp = Inputs.GetProperty("vIn");         vTemp = vTemp.replace( /[\r\n]+/gm, "");         Outputs.SetProperty("vOut",vTemp);         return (CancelOperation);     }   See Also: How to remove Line Break when selecting data from SQL Server

How to remove Line Break when selecting data from SQL Server

When you run SELECT query and copy the result to notepad or excel instead of one row columns with new line character shifts to new row. char(13) is carriage return (is a control character or mechanism used to reset a device's position to the beginning of a line of text) and char(10) is line feed (new line). Below query will eliminate carriage return and new lines from a column of a table. The inner replace replaces line feed and the outer replace replace carriage return SELECT Replace ( Replace( X_DIVISION, CHAR (10), '' ), CHAR (13), '' ) FROM S_CASE_X WHERE PAR_ROW_ID = '1-8I4G98D' Source: Stackoverflow 28628342, Wikipedia See Also: How to remove Line Breaks from a string using Siebel eScript