cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Mapper- string to int

vsuresh
New Contributor

Hello.

I have a string value being returned. It contains numbers 0,1,2,3,4 and some empty strings. I need to insert this into a int datatype field which allows NULL values. How do I convert the string to int and the blanks to NULL and map.

Thanks

3 REPLIES 3

cjhoward18
Employee
Employee

@vsuresh

I am not exactly sure what you mean by a string that contains numbers and some empty strings.

Can you give a specific example (input/output pair) of the data you have and are trying to get?

vsuresh
New Contributor

I have an input value of string datatype. It has values 0,1,2,3,4 and blanks( empty values). I want to convert this to datatype int for the numbered values and the blanks I want to convert to NULL value since the field in the table takes NULL values. Please let me know if this makes sense.

Thanks

@vsuresh

so the doc looks like this exactly?:
{values: โ€œ0, 1,2,3,4โ€}

or is there commas separating the empty values like this?:
{values: โ€œ0, ,1,2,3,4โ€}

and the desired result is this?:
{values: [0, Null. 1, 2, 3, 4]}