csv2plot.awk
Generated on Tue Dec 05 17:39:05 Eastern Standard Time 2006 from csv2plot.awk
# Program : CSV2PLOT.AWK
# Purpose : Convert standard Comma Separated Value files into a format for use by PIECHART
# Author : Bob Jonkman <bjonkman@sobac.com>
# Copyright 2008 Bob Jonkman and/or SOBAC Microcomputer Services
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Date : 30 June 2005
# Note : for PIECHART see http://www.usf.uos.de/~breiter/tools/piechart/piecharts.en.html
# Usage : gawk -f CSV2PLOT.AWK -v LABELCOL=n VALUECOL=m filename.CSV > filename.CSV.PLOT
# piechart -t filename -T png < filename.CSV.PLOT > filename.CSV.PNG
BEGIN { FS = "," ;
}
(FNR == 1) { print("# " $0) ;
print("") ;
}
($0 == "=====") { exit ;
}
(FNR != 1) { print($LABELCOL,$VALUECOL)
}
# EOF: CSV2PLOT.AWK
1 files processed.