ConvertNumberToString

ConvertNumberToString

This generator converts a number like '123456789' into a character representation of specified 'size'. e.g. '123456789' will result in 'aaaaaaaaaapHnxu' using the default character set 'a-zA-Z' and 'size'=15.

Attributes
Name Description Required Min Max Allowed Values
name (Class)Name of this element. Used to identify plugin Class. Full name is required. Example: com.en.myPluginPackage.myPuginClass no 0 1
id Identification String of this element. May be used to uniquely identify a field within the children of an Element. no 0 1
Nodes
Name Description Required Min Max Allowed Values
characters Content type: String
Sets characters this generator uses for generating a random string.
Default: abcdefghijklmnopqrstuvwxyzvABCDEFGHIJKLMNOPQRSTUVWXYZ
no 0 1
size Content type: Integer
Length of the string to be generated from the number. Example: input number '123456789' will result in: 'aaaaaaaaaapHnxu' using the default character set 'a-zA-Z' and 'size'=15.
yes 1 1
gen Value Generator for this field no 0 1

Examples

  1. Convert Number To String

    Uses a sub-generator to generate number between 10000 and 20000. These number are then subsequently converted to character strings using the default alphabet "abcdefghijklmnopqrstuvwxyzvABCDEFGHIJKLMNOPQRSTUVWXYZ".

    Schema config for Convert Number To String
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="CONVER_NUMBER_TO_STRING">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Convert Number To String-->
          <!--
            Uses a sub-generator to generate number between 10000 and 20000. These number are then subsequently converted to
            character strings using the default alphabet "abcdefghijklmnopqrstuvwxyzvABCDEFGHIJKLMNOPQRSTUVWXYZ".
          -->
          <field name="string" size="" type="VARCHAR">
            <gen_ConvertNumberToString>
              <size>6</size>
              <gen_LongNumber>
                <min>10000</min>
                <max>20000</max>
              </gen_LongNumber>
            </gen_ConvertNumberToString>
          </field>
          </table>
    </schema>
    
    Output for Convert Number To String
    aaaevf
    aaahfN
    aaagNf
    aaaeaH
    aaagey
    aaaflM
    aaafjB
    aaaeyD
    aaaeAE
    aaagHQ
  2. Convert Number To String with Custom Alphabet

    Uses a sub-generator to generate number between 10000 and 20000. These number are then subsequently converted to character strings using the custom alphabet "abcd".

    Schema config for Convert Number To String with Custom Alphabet
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!--
    /*******************************************************************************
    * Copyright (c) 2013, bankmark and/or its affiliates. All rights reserved.
    * bankmark UG PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    ******************************************************************************/
    --><schema xmlns:doc="http://bankmark.de/pdgf/doc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="demo" xsi:noNamespaceSchemaLocation="structure/pdgfSchema.xsd">
      <!-- All data is derived from this starting seed.
           If this seed is the same, the generated data will the same on each
           computer/node/platform.
           Change this seed to generate a different data set.-->
      <seed>1234567890L</seed>
    
      <rng name="PdgfDefaultRandom"/>
    
      <!--Default Scale factor for all tables -->
      <property name="SF" type="double">1</property>
    
      <table name="CONVER_NUMBER_TO_STRING">
        <!-- if tables should scale with -SF command line argument.
             Specify your scaling formula here: -->
        <size>10 * ${SF}</size>
    
        <!--Convert Number To String with Custom Alphabet-->
          <!--
            Uses a sub-generator to generate number between 10000 and 20000. These number are then subsequently converted to
            character strings using the custom alphabet "abcd".
          -->
          <field name="string_with_alphabet" size="" type="VARCHAR">
            <gen_ConvertNumberToString>
              <size>8</size>
              <characters>abcd</characters>
              <gen_LongNumber>
                <min>10000</min>
                <max>20000</max>
              </gen_LongNumber>
            </gen_ConvertNumberToString>
          </field>
          </table>
    </schema>
    
    Output for Convert Number To String with Custom Alphabet
    bacbdcdc
    acdcabcb
    adaaabaa
    badabbcc
    adbabaab
    bacabbcb
    bacdbbbc
    badbbacb
    baadaadb
    acccddac
2.7-83fb0 | 2020-04-22