Skip to content

Instantly share code, notes, and snippets.

@akesterson
Created April 23, 2015 06:05
Show Gist options
  • Save akesterson/ff7bcfe925b9621e47e5 to your computer and use it in GitHub Desktop.
Save akesterson/ff7bcfe925b9621e47e5 to your computer and use it in GitHub Desktop.
Convert Keeper CSV exports to Lastpass CSV import
This isn't 100%, but it will get you most of the way there (assumes bash 4+):
(\
echo 'url,type,username,password,hostname,extra,name,grouping' ; \
cat KEEPER_BACKUP_FILE | sed -e s/' '/'|'/g -e s/','//g | (\
while read LINE; do \
IFS='|' read -r -a fields <<< "$LINE"; \
type="server"; \
if [[ "${fields[4]}" == "" ]]; then \
type=''; \
fields[4]="http://sn"; \
fi; \
echo "${fields[4]},server,${fields[2]},${fields[3]},,${fields[5]},${fields[1]},${fields[0]}"; \
done\
) \
) > SOME_NEW_FILE.csv
You will need to manually go through the CSV this generates, it is not accurate enough to trust it 100%. But it will get you going.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment