Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Topic: Strip out a carriage return from string Posted: 20 Nov 2014 at 3:27am
I have a string field where several of the values contain carriage returns or something that is causing a line break when I export out the report to a CSV. I need to strip out whatever is causing this to happen.
The field is table.billing_address
My initial thought was to create a formula field to replace the carriage return with "", but I cannot figure out how to do that.
Has anyone else encountered this before? Ideas for solving this problem?
Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Posted: 20 Nov 2014 at 4:16am
Found a solution. I will share it here in case anyone else has the same problem.
Created a new Formula:
stringvar output := {TABLE_NAME.FIELD_NAME};
output := Trim(output); //get rid of leading & trailing spaces
output := Replace(output,Chr(13),''); //get rid of line feed character
output := Replace(output,Chr(10),''); //get rid of carriage return character
//add any other special characters you want to strip out.
Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Posted: 20 Nov 2014 at 4:32am
DBlank,
Thanks for the response. I didn't know about CHR values until today. I found a list of special characters to use as a reference in the future:
Character 8 - Chr(8): Backspace
Character 9 - Chr(9): Tab (vbTab)
Character 10 - Chr(10): Line Feed Return (vbLf)
Character 11 - Chr(11): Shift+Enter (vbVerticalTab)
Character 12 - Chr(12): Page Break (vbFormFeed)
Character 13 - Chr(13): Carriage Return
Character 14 - Chr(14): Column Break
Character 15 - Chr(15): Shift In
Character 32 - Chr(32): Space
Do you know of a good resource I can bookmark to reference for other special characters?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum