Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
didierodayo
Partner - Creator III
Partner - Creator III

Best way to format field

Hello.

I have a field that looks like below, I need to replace the / and remove any 0 that follows immediately.

CURRENT

2455691/0023

2451987/01564

9871256/0100

OUTPUT

2455691_23

2451987_1564

9871256_100

What is the best script for this scenario?

Thanks

1 Solution

Accepted Solutions
vengadeshpalani
Creator
Creator

Replace:

LOAD *,

  subfield(Input, '/', 1) & '_' & num(subfield(Input, '/', -1))as output;

LOAD * INLINE [

    Input

    2455691/0023

    2451987/01564

    9871256/0100

];

ans.PNG

View solution in original post

4 Replies
marcus_sommer

Try it with:

subfield(YourField, '/', 1) & '_' & num(subfield(YourField, '/', 2))

- Marcus

vengadeshpalani
Creator
Creator

Replace:

LOAD *,

  subfield(Input, '/', 1) & '_' & num(subfield(Input, '/', -1))as output;

LOAD * INLINE [

    Input

    2455691/0023

    2451987/01564

    9871256/0100

];

ans.PNG

didierodayo
Partner - Creator III
Partner - Creator III
Author

Hi Marcus/Vengadesh,

both script work, could you explain the subfields?

Thanks

MindaugasBacius
Partner - Specialist III
Partner - Specialist III