Initial commit. Initial working version.

This commit is contained in:
2026-06-16 14:40:29 +02:00
parent 2c63996f31
commit c7f7ae8f72
6 changed files with 299 additions and 1 deletions
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
# keila2csv — Convert a Keila contact export to a flat CSV
#
# Expands the "data" JSON column into individual columns, one per custom field.
# The resulting file is easy to open in a spreadsheet or process with other tools.
#
# Usage:
# keila2csv <keila_export.csv> <output.csv>
require_relative "lib/keila_csv_lib"
if ARGV.length != 2
warn "Usage: #{File.basename($PROGRAM_NAME)} <keila_export.csv> <output.csv>"
exit 1
end
input_path, output_path = ARGV
unless File.exist?(input_path)
warn "Error: Input file not found: #{input_path}"
exit 1
end
result = KeilaCsv.keila_to_csv(input_path, output_path)
fields_info = result[:custom_fields].empty? \
? "no custom fields found" \
: "custom fields: #{result[:custom_fields].join(', ')}"
puts "Converted #{result[:contacts]} contact(s) — #{fields_info}"
puts "Written to: #{output_path}"