altocompta/dev/csv-tools/analyze.sh
Dany De Bontridder 110335b08c Merged revisions 3264-3278 via svnmerge from
file:///home/developper/svn/phpcompta/branches/rel510

........
  r3268 | danydb | 2010-06-03 00:41:59 +0200 (Thu, 03 Jun 2010) | 1 line
  
  Add script for creating class based on a table
........
  r3269 | danydb | 2010-06-03 00:42:51 +0200 (Thu, 03 Jun 2010) | 1 line
  
  Add script for creating class based on a table
........
  r3271 | danydb | 2010-06-03 22:01:05 +0200 (Thu, 03 Jun 2010) | 10 lines
  
  remove obsolete comment
  =======================
  include/class_lettering.php 
  
  Improve generation of PHP Class for a table
  ===========================================
  dev/create_phpclass.py   
  dev/create_file_table.sql
........
  r3272 | danydb | 2010-06-03 22:30:59 +0200 (Thu, 03 Jun 2010) | 2 lines
  
  remove obsolete
........
  r3273 | danydb | 2010-06-03 22:38:28 +0200 (Thu, 03 Jun 2010) | 1 line
  
  create_phpclass.php improve it
........
  r3274 | danydb | 2010-06-04 01:06:20 +0200 (Fri, 04 Jun 2010) | 2 lines
  
  create_phpclass : add insert, new comment, fix load function
........
  r3275 | danydb | 2010-06-04 14:02:59 +0200 (Fri, 04 Jun 2010) | 1 line
  
  add doc
........
  r3276 | danydb | 2010-06-04 14:44:55 +0200 (Fri, 04 Jun 2010) | 1 line
  
  Generate child object
........
  r3277 | danydb | 2010-06-09 15:57:54 +0200 (Wed, 09 Jun 2010) | 1 line
  
  Remove useless transform.py
........
  r3278 | danydb | 2010-06-09 15:58:26 +0200 (Wed, 09 Jun 2010) | 1 line
  
  Housekeeping : create subfolders
........
2010-06-09 13:58:58 +00:00

26 lines
556 B
Bash

#!/bin/bash
# Utility for analysing CSV files
#
# GNU Gpl Author: Dany De Bontridder
#########################################################################
Help () {
echo "Usage is $0 start end "
echo "or"
echo "Usage is $0 line "
}
Help
FILE=file.csv
if [ $# -eq 2 ]; then
START=$1
END=$2
sed -ne "${START},${END}p" $FILE |
awk 'BEGIN {FS=";"} { for ( i=1; i<NF;i++) { print "field nb"i"->"$i;}}'
fi
if [ $# -eq 1 ]; then
START=$1
sed -ne "${START}p" $FILE |
awk 'BEGIN {FS=";"} { for ( i=1; i<NF;i++) { print "field nb"i"->"$i;}}'
fi