Sample code for 30+ languages & platforms
Lua Requires Chilkat v9.5.0.89+

CSV - Convert Comma to Semicolon Separators

See more CSV Examples

Load a CSV using comma delimiters and convert to a CSV using semicolon delimiters.

Chilkat Lua Downloads

Lua
local chilkat = require("chilkat")

local csv = chilkat.Csv.new()

local success = csv:load_file2("qa_data/csv/csv_wit_comma_separators.csv", "utf-8")
if not success then
    print(csv.last_error_text)
    return
end

-- Note: Updating the Delimiter property will cause
-- all already-existing rows in the CSV
-- to be updated with the new delimiter.
csv.delimiter = ";"

print(csv:save_to_string())