This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This stupid script can convert slack json exports | |
# (created with https://solawivuml.slack.com/apps/A19P6G35Y-export?next_id=0) | |
# to rocket.chat csv imports. | |
# The zip file can be directelly imported into rocket.chat. | |
test -z $1 && echo "usage: $0 slack_export_json_file.json channel_name" && exit 1 | |
# format users (needed for import) | |
cat $1 | jq '.[] | {name,real_name} | @json' | awk -F '"' '{print $5","$5"@dummy.import,"$9}' | sed 's#\\##g' | sort -n | uniq >users.csv |