Skip to content

Instantly share code, notes, and snippets.

@icostan
Last active June 11, 2021 22:11
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icostan/67ad186e5a89a11fc404832620a8b48f to your computer and use it in GitHub Desktop.
Save icostan/67ad186e5a89a11fc404832620a8b48f to your computer and use it in GitHub Desktop.
Transform exported iCloud passwords into Bitwarden's CSV format.
#!/usr/bin/env ruby
require 'csv'
CSV.open('bitwarden.csv', 'w') do |csv|
csv << ['folder', 'favorite', 'type', 'name', 'notes', 'fields', 'login_uri', 'login_username', 'login_password', 'login_totp']
CSV.open('~/Desktop/pm_export.csv', headers: true).each do |row|
data = ['', 0, 'login', row['Title'], '', '', row['Login URL'], row['Login Username'], row['Login Password'], '']
csv << data
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment