[WIP] A bash tool to read/write in tsv like db files.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
282 B

#!/usr/bin/awk -f
NR==1 {}
NR==2 {
names=""
colors=""
formats=""
for(i=1; i<=NF; i++)
{
name=$i
col=$i
fmt=$i
gsub(/%[\-0-9.*a-z]*\s/,"",name)
head=head$i"="i";"
gsub(/^[^%]*%/,"%",col)
format=format"f"$i"=\""col"\";"
}
print "NR==1{} NR==2{"head" "format"}"
}