Skip to content

A random address from the list read by `Csv.readAddress`, split into street, number, number addition, zip code and city. The first call to any part function picks a random data row (never the header row) and keeps it: all following calls return parts of that same address. `scramble` forgets it so the next call picks a new one. The file needs the header row and at least one data row; a file with only a header line or no lines throws an error when a part is requested. Column 1 is street and number (`Main Street 12a`), column 2 the zip code and column 3 the city.

How to get one

  1. Csv .readAddress()
  2. ListAddress
local listAddress = Csv.readAddress(fileLocation, delimiter)

Functions

  • number string Returns the digits of the street column with everything else removed (`Main Street 12a` gives `12`).
  • numberAddon string Returns the text after the house number in the street column (`Main Street 12a` gives `a`), or an empty string when there is none.
  • zipcode string Returns the zip code column with every character removed that is not a letter, digit or whitespace.
  • street string Returns the street column with the digits removed (`Main Street 12a` gives `Main Street a`).
  • city string Returns the city column of the current address, trimmed.
  • scramble self Forgets the current address so the next part function picks a new random one.
listAddress.number()→string

Returns the digits of the street column with everything else removed (`Main Street 12a` gives `12`).

Returns

string
listAddress.numberAddon()→string

Returns the text after the house number in the street column (`Main Street 12a` gives `a`), or an empty string when there is none.

Returns

string
listAddress.zipcode()→string

Returns the zip code column with every character removed that is not a letter, digit or whitespace.

Returns

string
listAddress.street()→string

Returns the street column with the digits removed (`Main Street 12a` gives `Main Street a`).

Returns

string
listAddress.city()→string

Returns the city column of the current address, trimmed.

Returns

string
listAddress.scramble()→self

Forgets the current address so the next part function picks a new random one. Returns the address helper itself, so it can be chained: `addresses.scramble().city()`.

Returns

self chainable The listAddress itself, so calls can be chained.