Home modules.gotpike.org
Username: Password: [Create Account]
[Forgot Password?]

Pike Module Reference:

module version 0.2, prepared 2012-02-04

  MODULE Public
Modules
Standards

  MODULE Public.Standards
Modules
CSV

  MODULE Public.Standards.CSV
Methods
dequote()
detect_type()
enquote()

Method enquote

string Public.Standards.CSV.enquote(string in)

Description

Enquote data to be put into a CSV file This means doubling the quoting character: " -> ""

Parameter in

The string to quote Example: John "foo" Doe

Returns

The quoted string, ready to be written in a CSV file Example: John ""foo"" Doe


Method dequote

string Public.Standards.CSV.dequote(string in)

Description

Dequote data taken from a CSV file This means reducing double quoting character: "" -> "

Parameter in

The string to dequote Example: John ""foo"" Doe

Returns

The string unquoted, ready to be processed Example: John "foo" Doe


Method detect_type

mixed Public.Standards.CSV.detect_type(mixed v)

Description

Determines the "human" type of a string.

In CSV, data are stored as strings, but the actual value can be of any type.

Example: "42" -> 42 "3.14" -> 3.14

Parameter v

The data we want to determine type

Returns

The actual value, casted as the determined type.

gotpike.org | Copyright © 2004 - 2011 | Pike is a trademark of Department of Computer and Information Science, Linköping University