1

Sometimes you need data for tests, like Adobe Thermo has prewritten "sets" of data, like 1-word strings, 3-word strings, etc for use in populating data controls.

I need:

  • Continuous text, no newlines
  • CSV Numbers, Integers
  • CSV Numbers, Decimals
  • URL encoded strings

Any ideas on how to get any of those?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Robin Rodricks
  • 110,798
  • 141
  • 398
  • 607

5 Answers5

2

GenerateData.com is a free, open source script written in JavaScript, PHP and MySQL that lets you quickly generate large volumes of custom data in a variety of formats for use in testing software, populating databases.

  • JS-enabled and browser-friendly.
  • Many data types: names, phone numbers, email addresses, cities, states, provinces, counties, dates, street addresses, number ranges, alphanumeric strings, lorem ipsum text and more.
  • Option to generate data in XML, Excel, HTML, CSV or SQL.
  • Country specific data (state / province / county) for Canada, US, Netherlands and UK.
  • Saves your data generation forms for later use
Robin Rodricks
  • 110,798
  • 141
  • 398
  • 607
1

Try www.mockaroo.com.

This is a free tool that let's you generate up to 100,000 rows of realistic test data in CSV, tab-delimited, and SQL formats. You can generate just about any data type: strings, numbers, emails, domains, urls, addresses, names, unicode, custom values based on a formula you provide and a lot more. You can also save your schemas for reuse.

Sasha Brocato
  • 673
  • 10
  • 14
  • FYI, If you're looking specifically for a set of URLs to test with -- as I was -- the Mockaroo site is better. Unlike GenerateData.com, it has a specific 'url' data type. You can even customize the URL features to generate. – EdwinW Oct 11 '13 at 21:14
1

Generate them? A quick perl script can generate huge sets of data.

Part of the challenge with CSV is all the edge cases (awkward standard-use of newlines, which does not exactly match how Excel or SQL Server parse CSVs). I've had to build those by hand in the past.

user54650
  • 4,388
  • 2
  • 24
  • 27
1

Continuous text, no newlines

Download a few files from Project Gutenberg and run sed on it to replace newlines by whitespace.

CSV Numbers, Integers

Google/Y! finance AFAIK allows you to download historical stock quotes. That'd be a nice start. But they are usually a mixture of string(stock name), date and 4 different floating values and one integral volume value.

dirkgently
  • 108,024
  • 16
  • 131
  • 187
1

I simply made (in VB.NET) a helper class to generate random strings of a length in a specified range, or random numbers. I did this when first trying unit testing within Visual Studio. So, for example, when I wanted to test Customer.Create, I would set up a loop to run 1000 times to create 1000 customers with all kinds of random values. For example,

(pseudo-real-code)

For x = 1 to 1000
    Dim c as New Customer
    c.Name = Helpers.GetRandomString([minLenth], [maxLength])
    c.Address1 = Helpers.GetRandomString([minLenth], [maxLength])
    c.Telephone = Helpers.GetRandomPhoneNumber()
    ...
Next
HardCode
  • 6,497
  • 4
  • 31
  • 54