diff options
author | sinanmohd <sinan@firemail.cc> | 2023-06-30 11:26:22 +0530 |
---|---|---|
committer | sinanmohd <sinan@firemail.cc> | 2023-06-30 12:25:50 +0530 |
commit | 76f5872f5f739217caccc98ac185d8a5d24b1a95 (patch) | |
tree | 4b49ea20e852637e2440f9b0ad97288723464039 | |
parent | 3d0e74fda2a137179ee4e06b7f21a7b9dafd2ecb (diff) |
vtoc.sh: initial commit, convert vcf to csv, replaces vtono.sh
-rwxr-xr-x | bin/vtoc.sh (renamed from bin/vtono.sh) | 6 | ||||
-rwxr-xr-x | zukbeam | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/bin/vtono.sh b/bin/vtoc.sh index dd4f8b6..f2be2cb 100755 --- a/bin/vtono.sh +++ b/bin/vtoc.sh @@ -23,8 +23,8 @@ no= vcf= nos= -if [ -z "$1" ] \ - || [ "$(file --brief --dereference --mime-type "$1")" != "text/vcard" ]; then +if [ -z "$1" ] || + [ "$(file --brief --dereference --mime-type "$1")" != "text/vcard" ]; then die "no or invalid input" else vcf="$1" @@ -69,7 +69,7 @@ strings "$vcf" | while read -r line; do continue [ -n "$no" ] && - printf "%s : %s\n" "$no" "$name" + printf "%s, %s\n" "$no" "$name" ;; 'END:VCARD') nos= @@ -117,15 +117,15 @@ kill-daemon) kill_daemon exit ;; -vtono) +vtoc) [ -z "$infile" ] && infile="${data_dir}/contacts.vcf" [ -z "$outfile" ] && - outfile="${data_dir}/contacts.txt" + outfile="${data_dir}/contacts.csv" [ ! -s "$infile" ] && - die "vtono: ${infile}: no such file or directory" - vtono.sh "$infile" > "$outfile" && - note "vtono: contacts saved to ${outfile}" + die "vtoc: ${infile}: no such file or directory" + vtoc.sh "$infile" > "$outfile" && + note "vtoc: contacts saved to ${outfile}" ;; "") kill_daemon |