Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Data Parsing

Giorgio Caviglia edited this page Apr 3, 2014 · 1 revision

raw.parser([delimiter])

Constructs a new parser for delimiter-separated values. If delimiter is specified, it will be used to parse the data. If delimiter is not specified, the parser will automatically detect the delimiter by choosing it from a list of commonly used delimiters. Currently the available delimiters are: commas ,, semicolons ;, tabs \t, colons : and vertical bars |.

parser(string)

Parse the string, returning an array of objects representing the parsed rows.

[
	{ title : "Avatar", genre : "Action", budget : 425000000 },
	{ title : "The Blind Side", genre : "Drama", budget : 35000000 },
	... 
]

parser.metadata(string)

Returns an array of the dimensions in the data. Each dimension is an object with: a key property with the actual name of the dimension; a type property indicating a guessed data type for that dimension. The data type is based on the mode of all the types for all the values in that dimension. Currently three types are available: numbers, strings and dates. The types are used within RAW to help the users better understanding what they can - or can not - do with their data dimensions (see Models for more information).

[
	{ key : "title", type : 'string' },
	{ key : "genre", type : 'string' },
	{ key : "budget", type : 'number' },
	...
]
Clone this wiki locally