akkadian-lang/src/scripts/tab2csv.awk

19 lines
206 B
Awk
Raw Permalink Normal View History

2020-06-22 12:47:23 +00:00
#!/usr/bin/gawk -f
BEGIN {
f="/dev/stdout"
}
/^# / {
match($0, /^#[\ \t]+(.*)$/, a);
f = a[1] ".csv";
gsub(/\ /, "_", f);
next;
}
/^.+$/ {
l = $0;
gsub(/\t+/, ";", l);
2020-06-22 12:47:23 +00:00
printf("%s\n", l) >> f;
}