The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

Add leading zeros if length = 4

syazwaansyazwaan Member Posts: 3 Learner I
I have a dataset something like this:

I want to add leading 0 if the length of data in column_1 is 4 and return in a new column. So that all data in the new column will be the length of 5.

Expected output:

Thank you.

Best Answer

  • BalazsBaranyBalazsBarany Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert Posts: 955 Unicorn
    Solution Accepted
    Hi!

    If the data are numeric, you can use Format Numbers with a pattern of 00000. This will convert the numbers to a nominal column with the specified format that includes the leading zero if necessary. This would also work for smaller numbers.

    Regards,
    Balázs

Answers

Sign In or Register to comment.