20 lines
482 B
Bash
Executable File
20 lines
482 B
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
# target filename
|
|
tn="dhl-ds-versendung.csv"
|
|
|
|
# todo: download file (its UTF-8 encoded)
|
|
|
|
fn="dhl-ds-versendung-3.csv"
|
|
# backup
|
|
cp -f "$fn" "dhl.csv"
|
|
|
|
# replace special spaces and hyphens
|
|
sed -i -e 's/[\u00A0\u202F[:space:]]+/ /g' -e 's/[\u2010\u2011\u2012\u2013\u002D]+/-/g' -e 's/[\u00AD\uFEFF]+//g' "$fn"
|
|
|
|
# todo: convert encoding from UTF-8 to CP1252 "Windows"
|
|
|
|
# a possibility for conversion? seems not to be reliant
|
|
iconv -o "$tn" -f UTF-8 -t CP1252 "$fn"
|
|
|