Skip to content

Instantly share code, notes, and snippets.

@atcasanova
Last active June 24, 2020 19:59
Show Gist options
  • Save atcasanova/01d695846a5bfb02a76a0df77cf9271d to your computer and use it in GitHub Desktop.
Save atcasanova/01d695846a5bfb02a76a0df77cf9271d to your computer and use it in GitHub Desktop.
#!/bin/bash
while read line; do
# atribuir dados às variáveis
nome=$(echo "$line" | cut -f1 -d";")
email=$(echo "$line" | cut -f2 -d";")
empresa=$(echo "$line" | cut -f3 -d";")
telefone=$(echo "$line" | cut -f4 -d";")
filename="$(echo -n "$email" | sha256sum | cut -f1 -d" ").txt"
# montar o arquivo
echo "Nome: $nome" > $filename
echo "E-Mail: $email" >> $filename
echo "Empresa: $empresa" >> $filename
echo "Telefone: $telefone" >> $filename
done < data.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment