Spreadsheets

Find non-duplicates across workseets

  1. =VLOOKUP($1,sheet!$2:$2;1;FALSE)

  2. Autofilter

  3. Filter our just N/A

  • $1 = Compare A column + Row

  • $2 = Compare B Column (Uses all Rows)

Convert a CSV into SQL Inserts

#!/bin/bash

# MIT License: Copyright (c) 2017 Pavan Chhatpar
# https://github.com/pavanchhatpar/csv-to-sql-converter/blob/master/csv-sql.sh

fname="$1"

# Clean File
sed 's/\s*,*\s*$//g' "$fname" > tmp.csv

# Get input File
op=$(echo "$fname" | cut -d"." -f 1)

# Make output file
opfile="$op.sql"

# Table Name
op="\`$op\`"

# Get Columns
columns=$(head --lines=1 tmp.csv | sed 's/,/`,`/g' | tr -d "\r\n")
columns="\`$columns\`"

# Loop input and create SQL Inserts; Pipe to output file
tail --lines=+2 tmp.csv | while read l ; do
 values=$(echo $l | sed 's/,/\",\"/g' | tr -d "\r\n")
 values="\"$values\""
 echo "INSERT INTO $op($columns) VALUES ($values);"
done > "$opfile"

# Remove temporary cleaned input
rm tmp.csv

Execute using Bash Ctrl+X+E, to not create a file