Creating Sample Data

May 1, 2009

Nothing earth shattering today, but I thought it was neat.  Every now and then I come across a document I would like to add to my test suites for a project, but there’s a problem.  The document might contain email addresses, phone numbers, who knows what, and I don’t really want that to be sitting around in my codebase, but the structure of the document matters.  The solution? Pipe it through this:

tr 'A-Za-z0-9' 'a-ff-aa-fa-ff-aa-fa-ff-aa-f001122334455'

Now all of your punctuation and such is preserved for your parsing pleasure, but the data is somewhat obfuscated. Of course use it at your discretion.

For bonus points, I actually made it into a TextMate command. Now I can have my test data, and feel reasonably safe about it.

Entry Filed under: Uncategorized. .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


AdamSanderson

del.icio.us

Feeds

Pages

 

May 2009
M T W T F S S
« Apr   Jun »
 123
45678910
11121314151617
18192021222324
25262728293031

Archives

Blogroll

Meta