Fixed Number

Let's begin with the simplest field that generates the same number across all rows. Sometimes, we need uniform values throughout, such as when using a constant. By setting the Data Type to Number and the Value Type to Fixed, we ensure a fixed number is generated across all rows.

We can input numbers with decimal places to generate consistent decimal values as well:

Incremental Number

Incremental numbers are often used when generating test data. For instance, a database table typically has its primary key column set to start at a certain integer and increment by a specified value. When a new row is added, its ID is automatically incremented. ParroFile's Incremental Number feature functions similarly, generating integers that start at 1 and increment by 1 for each new entry in the example above.

We can decrement the number by using a negative value after the "+" sign. For example, starting at -1, the value will decrease by 1 with each step.

The output file will display the decrementing values as shown below.

The incremental number feature also supports decimal values for both the starting number and the incremental step.

The output file will display the incrementing values as shown below.

Discrete Number

Discrete numbers are indivisible values, often used as IDs in records, such as customer IDs in a database table.

Enter these discrete numbers in the text field, separating each number with a comma. These numbers may include decimal places.

3 distribution types determine how discrete numbers are displayed in the output file: Chunk, Iterative, and Random. By default, the Chunk distribution type is used.

For example, if you enter 1, 2, and 3 as discrete numbers and need to generate 9 rows, the number 1 will appear in the first 3 rows, 2 in the next 3 rows, and 3 in the final 3 rows. For 99 rows, 1 will appear in the first 33 rows, 2 in the next 33, and 3 in the final 33.

The next distribution type is Iterative. Using the Iterative distribution, each discrete number is shown once per row by default.

However, you have the option to specify the number of rows each discrete number will appear in. For instance, you can configure it to display the same discrete number for 2 consecutive rows.

The final distribution type is Random.

Unlike Chunk and Iterative, where discrete numbers are printed in a specific order (e.g., entering 1,2,3,4,5,6,7,8,9,10 prints 1 first and 10 last), the Random distribution shuffles the numbers to make the data appear more realistic. For instance, if the field represents customer IDs, this prevents ID 1 from always being at row 1 and ID 10 at row 10.

In Random distribution, numbers can also repeat across multiple rows, similar to Iterative.

Below is an example of how the output looks with Random distribution, with each number repeated for every 2 rows.

Keep in mind that discrete numbers don't have to be unique. You can enter the same number multiple times in the text field.

This is particularly useful when you want a certain number to appear more frequently than others.

Random Number

You can generate random numbers within a specified range. By default, a random number between 1 and 10 is generated without decimal places.

You also have the option to specify the number of decimal places, with a maximum of 9 allowed.

Additionally, you can choose to repeat a random number a certain number of times in the output.

By default, random numbers are generated with a uniform distribution, meaning each number within the range has an equal probability of appearing. However, real-life datasets often follow a normal distribution.

ParroFile supports normal distribution as well. Click the button here to switch from uniform distribution to normal distribution.

When you switch, an extra text field will appear for you to enter a series of numbers. These numbers create a frequency histogram of the most frequent to the least frequent values.

For example, if 6 is three times more frequent than 1, you can enter 6,6,6,1. ParroFile will then calculate the normal distribution based on the frequency values you entered.

Number Expression

If you need to create a calculated field, you can use Expression Number. This feature allows you to create a field that returns a "double" data type using valid C# syntax expressions.

ParroFile comes preloaded with namespaces such as "System", "System.Linq", and "System.Collections.Generic", providing a wide range of functionalities for your C# expressions. A common class to use from "System" is "Math". For example, you can use the "Math.Abs" function to get the absolute value of another field.

When referencing a field, enclose the field name within square brackets. This enables you to write a one-line expression based on other fields.

Additionally, you can reference other Expression fields, and ParroFile will smartly detect field dependencies.

Fixed String

Our next data type is String. We'll begin with the simplest value type for String: Fixed.

Similar to Fixed Number, you can enter text that will consistently appear across the entire dataset.

Discrete String

Similar to Discrete Numbers, ParroFile supports Discrete Strings. You can input a series of strings separated by commas or newlines in the pop-up dialog.

If a string contains a comma, you can escape it with a backslash (\) so ParroFile knows the comma is part of the string and not a delimiter.

ParroFile also offers predefined discrete strings, saving you the effort of entering all values manually. Click the dictionary icon to access a list of predefined discrete strings provided by ParroFile.

Click on "Lastnames"

You'll notice the icon becomes filled.

Open it to find the predefined last names.

Unlike other data generation tools, ParroFile is designed to allow you to customize your values. If you prefer not to include certain last names in the output, you can modify them in the dialog.

Just like Discrete Number, Discrete String supports 3 distribution types: Chunk, Iterative, and Random. These work in the same way as they do for Discrete Number.

An additional feature of Discrete String is the ability to establish relationships with other fields. There are 2 types of relationships that a Discrete String field can have with other fields: Child to Parent and Parent to Child.

In a Child to Parent relationship, the current field (child field) contains strings that map to strings in a parent field. This means the child field depends on the parent field, and the child strings are derived from the parent field. Here's an example:

Create a field named "Make" with the distribution type set to Iterative and no repetition of the same value.

Enter 2 car manufacturers, BMW and AUDI, in the pop-up dialog.

Create another field named "Model". Click the Adjust Mode button to switch to "Child to Parent".

Open the pop-up dialog. You'll notice it has a different title and requires contents in a different format.

Enter X1,X3,X5:BMW on one line and Q1,Q3,Q5:AUDI on another line. This maps the child strings X1, X3, and X5 to the parent value BMW, and Q1, Q3, and Q5 to the parent value AUDI.

For the Parent Field, enter "Make" (without square brackets, as it’s not a C# expression).

Keep the distribution type as Iterative with no repetition of the same value.

Click "Generate File" and inspect the output Excel file.

The "Make" field will drive the output: it prints BMW first, then AUDI, then BMW again. For the "Model" field, it prints the corresponding models: for the 1st BMW record, X1; for the 2nd BMW record, X3; and for the 3rd BMW record, X5. The same logic applies to AUDI: for the 1st AUDI record, Q1; for the 2nd AUDI record, Q3; and for the 3rd AUDI record, Q5.

Now let's examine an example of a Parent to Child field:

Start by creating a "Model" field with the distribution type set to Iterative and no repetition of values.

In the pop-up dialog, enter X1, X3, X5, Q1, Q3, Q5.

Next, create a field named "Make" and set its mode to "Parent to Child". In the "Child Field" input, type "Model". In this setup, the "Model" field drives the output, and the "Make" field depends on the "Model" field. Remember, the driving field (either Parent to Child or Child to Parent) dictates the output sequence.

Open the pop-up dialog for the "Make" field. You'll notice a different title and format requirements.

Enter the parent value followed by a colon and the corresponding child strings from the "Model" field. For example, type "BMW:X1,X3,X5" on one line and "AUDI:Q1,Q3,Q5" on another.

In the "Child Field", type "Model".

Click "Generate File" and check the output Excel file. In this file, the "Model" field drives the output, printing X1 in the first row, followed by X3, X5, Q1, Q3, and Q5 in subsequent rows. The "Make" field will display the corresponding parent values for each child string.

Regular Expression String

The Regular Expression String is a highly versatile value type. It enables you to generate specific string values accurately using regular expressions.

ParroFile utilizes a third-party tool called Xeger for generating strings based on regular expressions. However, Xeger has some limitations with certain special characters, such as \d, \w, \s, and ?. Instead, use [0-9] for \d, [a-zA-Z0-9_] for \w, [ ] for \s, and avoid using the question mark (?).

If you're not familiar with regular expressions, ParroFile offers predefined values that you can easily select by clicking the dictionary icon.

You can also modify these predefined expressions to suit your needs, adhering to ParroFile's design principle of customization.

To construct and validate your regular expressions, a useful tool is regex101.com. Check it out at https://regex101.com/.

String Expression

Similar to Number Expression, String Expression is a valid C# expression that returns a String data type.

You can leverage various C# functions for string manipulation, including Trim, ToLower, ToUpper, Contains, StartsWith, EndsWith, IndexOf, Replace, Substring, Split, and Length.

Fixed DateTime

The final data type is DateTime, which returns the C# DateTime type. The simplest way to generate a DateTime value is through Fixed DateTime.

Using Fixed DateTime, you can select a date and time with the Bootstrap datetime control and specify the datetime format for display in the output file.

You can find datetime formats in the MSND official documentation here: https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings

Incremental DateTime

The next value type is Incremental DateTime. Similar to Incremental Number, Increment DateTime allows you to specify a start date, a time step, and a time period.

The first row in the output file will be the start date, and subsequent rows will show the datetime calculated as the start date plus the time step multiplied by the time period. For instance, if you set the start date to 2010-01-01, with a time step of 1 and a time period of Day, the first row will be 2010-01-01, and the following rows will increment by one day each.

You can use either positive or negative integers for the time step.

A variety of time periods are available, ranging from Second to Year.

Additionally, you can specify the display format of the datetime just like with Fixed DateTime.

Discrete DateTime

Similar to Discrete Numbers, Discrete DateTime allows users to specify a series of datetime strings in the format yyyy-MM-dd, separated by commas.

Discrete DateTime also supports three distribution types: Chunk, Iterative, and Random.

Additionally, users can specify a display format for the datetime values.

DateTime Expression

Lastly, DateTime supports the Expression value type, similar to Number and String.

You can utilize various C# functions with the DateTime type, such as AddHours, AddDays, and AddMonths. A complete list of functions can be found here: https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-8.0

A common use case for DateTime Expression is when you need to add a random number of days to a base date. In such scenarios, DateTime Expression proves to be quite useful.

Download Your File

Once you've configured all the required fields, you're ready to generate your test or mock data by clicking the "Generate File" button.

ParroFile currently supports a range of popular file formats, including CSV, Excel, JSON, and Parquet.

Looking ahead, ParroFile plans to expand its support to additional formats like XML, SQL, HTML, and more.

You can also specify the filename for the download and the number of rows of mock data you wish to generate.

Export and Import Fields

Before closing your browser or navigating to another site, make sure to use the Export Fields option to save all your fields once they are ready for generating your output file. This way, you can easily use the Import Fields feature in ParroFile to continue your work in the future.

What is ParroFile?

ParroFile is a versatile, free online data generation tool designed to help users quickly generate test, mock, or dummy data in a variety of file formats, including CSV, Excel, JSON, and Parquet.

This web application, built using the ASP.NET MVC Framework in C#, is incredibly user-friendly.

ParroFile features 2 main components: a list of customizable fields and a selection of output file formats, making it a convenient solution for your data generation needs.

What is Field?

In ParroFile, a field functions similarly to a column in a CSV file or a field in a database table.

Each field has 3 main attributes: Name, Data Type, and Value Type.

Name appears as a header in CSV, Excel, and PARQUET files, or as a property name in a JSON object.

Data Type specifies the kind of data the field holds, such as Number, String, or DateTime.

Value Type determines how the values for each row in the field will be generated, with options including fixed, incremental, or random values for numeric data types.

What is Data Type?

A field with the Number data type generates numeric values for each row. It uses the double type in C#, a 64-bit floating-point type.

A field with the String data type generates text values for each row, using the string type in C#.

A field with the DateTime data type generates text values that represent dates or date-time values for each row, implemented using the DateTime type in C#.

What is Value Type?

The Value Type of a field determines how each row's data is generated within a specific data type.

Number Data Type offers the following value types:

  • Fixed: Generates a constant number for all rows.
  • Incremented: Produces an incrementing number for each row.
  • Discrete: Fills the field with a specified set of numbers in varying patterns.
  • Random: Generates a random number for each row within a defined range.
  • Expression: Returns a calculated number based on other fields, excluding those of the Expression value type.

String Data Type supports the following value types:

  • Fixed: Generates a constant text for all rows.
  • Discrete: Fills the field with a specified set of texts in varying patterns.
  • RegEx: Generates text for each row with a specified regular expression.
  • Expression: Returns a calculated text based on other fields, excluding those of "Expression" value type.

DateTime Data Type supports the following value types:

  • Fixed: Generates a constant datetime for all rows.
  • Incremented: Produces an incrementing datetime for each row.
  • Discrete: Fills the field with a specified set of datetimes in varying patterns.
  • Expression: Returns a calculated datetime based on other fields, excluding those of "Expression" value type.