How to remove special character in the concat string?

Hi Team,

I have 3 columns and have special character on it. i want to remove the special character how ?

__t1=abc
__b1=bbc
__dat1=2017-12-01 16:09:28

and i want a output like abcbbc20171201160929.

Thanks in advance.
Mani.

Hello,
Here is an example that I believe produces what you are looking for in your request.

If you look at the “clean” field, that is where the magic happens.

((field(“t1”)+field(“b1”)+field(“dat1”).to_s).delete(’ ')).gsub!(/[^0-9A-Za-z]/, ‘’)

  • .to_s, converts the date field to a string

  • .delete(’ '), removes the whitespace

  • .gsub!(/[^0-9A-Za-z]/, ‘’), removes non-alphanumeric characters

Schema-
{
“id”: 98168,
“num_rows”: 1000,
“file_format”: “csv”,
“name”: “forum”,
“include_header”: true,
“columns”: [
{
“name”: “t1”,
“null_percentage”: 0,
“type”: “Regular Expression”,
“value”: “[:alpha:][:upper:]\d{4}”,
“formula”: “”
},
{
“name”: “b1”,
“null_percentage”: 0,
“type”: “Regular Expression”,
“value”: “[:alpha:][:upper:]\d{4}”,
“formula”: “”
},
{
“name”: “dat1”,
“null_percentage”: 0,
“type”: “Date”,
“min”: “04/01/2016”,
“max”: “2/7/2018”,
“format”: “%Y-%m-%d %H:%M:%S”,
“formula”: “”
},
{
“name”: “clean”,
“null_percentage”: 0,
“type”: “Formula”,
“value”: “((field(“t1”)+field(“b1”)+field(“dat1”).to_s).delete(’ ')).gsub!(/[^0-9A-Za-z]/, ‘’)”,
“formula”: “”
}
]
}

Hope this helps you out.
Rich