Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
shrikavi2008
Contributor
Contributor

generate credit card using trowgenerater

Hi ,
I want to generate customer sample data using tRowGenerater.
How to generate credit card number with 16 digits using tRowGenerater ?
Regards,
R.Bharath
Labels (2)
2 Replies
Anonymous
Not applicable

The approach that I usually take it to create a Talend 'Routine' for data generation and add the methods that you need.
Use tRowGenerator to generate the number of rows that you need, and map your fields using tMap.
Here's a method (and helper methods) for phone numbers. You could do something similar for Credit Card numbers.
static java.util.Random random = new java.util.Random();
public static int getRandom(int max) { return random.nextInt(max + 1); }
public static int getRandom(int min, int max) {
return random.nextInt(max) + min;
}
public static String makePhoneNumber() {
return String.format("0%d %d", getRandom(1231, 1881), getRandom(123456, 654321));
}
Alternatively, you may find that there is an open source Java package that generates this type of data.
Anonymous
Not applicable

Hi,
This can be done using tDataMasking which was released in Talend 6.0, as part of Enterprise Data Quality components.
Regards,
Cyril.