19 lines
210 B
Awk
19 lines
210 B
Awk
|
#!/usr/bin/gawk -f
|
||
|
|
||
|
BEGIN {
|
||
|
f="/dev/stdout"
|
||
|
}
|
||
|
|
||
|
/^# / {
|
||
|
match($0, /^#[\ \t]+(.*)$/, a);
|
||
|
f = a[1] ".csv";
|
||
|
gsub(/\ /, "_", f);
|
||
|
next;
|
||
|
}
|
||
|
|
||
|
/^.+$/ {
|
||
|
l = $0;
|
||
|
gsub(/[\ \t]+/, ";", l);
|
||
|
printf("%s\n", l) >> f;
|
||
|
}
|