|
List Info
Thread: "ocaml_beginners"::[] Recompiling csvtool
|
|
| "ocaml_beginners"::[]
Recompiling csvtool |

|
2006-11-24 09:05:06 |
|
Thanks to Richard for his csv-library.
I want to recompile csvtool with ExtLib after I got a stack overflow on my
first try on a large file.
I am having trouble to do it. I do not know the normal Makefile
conventions very well and uses OcamlMakefile most of the time.
Something must be wrong with my Makefile. I do not know how to change
Richard's Makefile supplied with the library.
My Makefile:
OCAMLMAKEFILE=/usr/share/ocaml-tools/OCamlMakefile
SOURCES=csvtool.ml
RESULT=csvtool
INCDIRS=+extlib +/usr/local/lib/ocaml/3.09.2/csv
LIBS=getopt unix extList /usr/local/lib/ocaml/3.09.2/csv
LIBDIRS=+getopt +extlib +/usr/local/lib/ocaml/3.09.2/csv
include $(OCAMLMAKEFILE)
/usr/local/lib/ocaml/3.09.2/csv contains:
csv.cma csv.cmi csv.cmo csv.cmx csv.cmxa csv.ml csv.mli csv.o
I have tried to make a META file for csv but I do not know how to do
that either and my feeble effort did not make a difference.
When I try and compile it, I get
% make
make[1]: Entering directory `/tmp'
ocamlc -c -I +extlib -I +/usr/local/lib/ocaml/3.09.2/csv csvtool.ml
File "csvtool.ml", line 6, characters 0-8:
Unbound module Csv
make[1]: *** [csvtool.cmi] Error 2
make[1]: Leaving directory `/tmp'
make: *** [byte-code] Error 2
Can you help me with my Makefile please?
Regards
Johann
--
Johann Spies Telefoon: 021-808 4036
Informasietegnologie, Universiteit van Stellenbosch
"Jesus saith unto him, I am the way, the truth, and the
life; no man cometh unto the Father, but by me."
John 14:6
__._,_.___
.
__,_._,___
|
| "ocaml_beginners"::[]
Recompiling csvtool |

|
2006-11-24 09:45:30 |
|
On Fri, Nov 24, 2006 at 11:05:06AM +0200, Johann Spies wrote:
> Thanks to Richard for his csv-library.
>
> I want to recompile csvtool with ExtLib after I got a stack overflow on my
> first try on a large file.
This sounds like a bug actually. What csvtool operation were you
trying to perform?
Anyway, try version 1.1.3 on the website:
http://merjis.com/developers/csv
You will need to edit the top of Makefile and csv.ml, but it should be
fairly obvious what to do to get it to link with and use ExtList.
Rich.
--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Internet Marketing and AdWords courses - http://merjis.com/courses - NEW!
Merjis blog - http://blog.merjis.com - NEW!
__._,_.___
.
__,_._,___
|
| "ocaml_beginners"::[]
Recompiling csvtool |

|
2006-11-24 09:48:56 |
|
I should add that I changed the command line parsing in csvtool quite
a bit in this version. It is much more consistent now, but you may
need to change any shell script(s) which depend on the old way.
Rich.
----------------------------------------------------------
csvtool - Copyright (C) 2005-2006 Richard W.M. Jones, Merjis Ltd.
csvtool is a tool for performing manipulations on CSV files from shell scripts.
Summary:
csvtool [-options] command [command-args] input.csv [input2.csv [...]]
Commands:
col <column-spec>
Return one or more columns from the CSV file. Columns are numbered
starting from zero.
For <column-spec>, see below.
Example: csvtool col 1-3,6 input.csv > output.csv
namedcol <names>
Assuming the first row of the CSV file is a list of column headings,
this returned the column(s) with the named headings.
<names> is a comma-separated list of names.
Example: csvtool namedcol Account,Cost input.csv > output.csv
width
Print the maximum width of the CSV file (number of columns in the
widest row).
height
Print the number of rows in the CSV file.
readable
Print the input CSV in a readable format.
cat
This concatenates the input files together and writes them to
the output. You can use this to change the separator character.
Example: csvtool -t TAB -u , cat input.tsv > output.csv
join <column-spec1> <column-spec2>
Join (collate) multiple CSV files together.
<column-spec1> controls which columns are compared.
<column-spec2> controls which columns are copied into the new file.
Example:
csvtool join 1 2 coll1.csv coll2.csv
If coll1.csv contains:
Computers,$40
Software,$100
and coll2.csv contains:
Computers,$50
then the output will be:
Computers,$40,$50
Software,$100,
square
Make the CSV square, so all rows have the same length.
sub r c rows cols
Take a square subset of the CSV, top left at row r, column c (counting
from 0), which is rows deep and cols wide.
replace <column-spec> update.csv original.csv
Replace rows in original.csv with rows from update.csv. The columns
in <column-spec> only are used to compare rows in input.csv and
update.csv to see if they are candidates for replacement.
Example:
csvtool replace 3 updates.csv original.csv > new.csv
mv new.csv original.csv
Column specs:
A <column-spec> is a comma-separated list of column numbers
or column ranges.
Examples:
1 Column 1 (the first, leftmost column)
2,5,7 Columns 2, 5 and 7
1-3,5 Columns 1, 2, 3 and 5
1,5- Columns 1, 5 and up.
Columns are numbered starting from 1 unless the -z option is given.
Input files:
csvtool takes a list of input file(s) from the command line.
Output file:
Normally the output is written to stdout. Use the -o option
to override this.
Separators:
The default separator character is , (comma). To change this
on input or output see the -t and -u options respectively.
Use -t TAB or -u TAB (literally T-A-B!) to specify tab-separated
files.
Options:
-t Input separator char. Use -t TAB for tab separated input.
-u Output separator char. Use -u TAB for tab separated output.
-o Write output to file (instead of stdout)
-z Number columns from 0 instead of 1
-help Display this list of options
--help Display this list of options
--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Internet Marketing and AdWords courses - http://merjis.com/courses - NEW!
Merjis blog - http://blog.merjis.com - NEW!
__._,_.___
.
__,_._,___
|
| "ocaml_beginners"::[]
Recompiling csvtool |

|
2006-11-24 10:14:44 |
|
On Fri, Nov 24, 2006 at 09:45:30AM +0000, Richard Jones wrote:
>
> This sounds like a bug actually. What csvtool operation were you
> trying to perform?
>
> Anyway, try version 1.1.3 on the website:
> http://merjis.com/developers/csv
>
> You will need to edit the top of Makefile and csv.ml, but it should be
> fairly obvious what to do to get it to link with and use ExtList.
Thanks. I could compile csv.ml now eith ExtList. That did not solve my
problem however:
Without ExtList:
% csvtool namedcol square 2006-11-06_134434.log > 2006-11-06_134434.log.sqr
Fatal error: exception Stack_overflow
With ExtList:
% csvtool namedcol square 2006-11-06_134434.log > 2006-11-06_134434.log.sqr
Fatal error: exception Not_found
Regards
Johann
--
Johann Spies Telefoon: 021-808 4036
Informasietegnologie, Universiteit van Stellenbosch
"Jesus saith unto him, I am the way, the truth, and the
life; no man cometh unto the Father, but by me."
John 14:6
__._,_.___
.
__,_._,___
|
| "ocaml_beginners"::[]
Recompiling csvtool |

|
2006-11-24 12:02:13 |
|
On Fri, Nov 24, 2006 at 12:14:44PM +0200, Johann Spies wrote:
> Without ExtList:
>
> % csvtool namedcol square 2006-11-06_134434.log > 2006-11-06_134434.log.sqr
> Fatal error: exception Stack_overflow
>
> With ExtList:
>
> % csvtool namedcol square 2006-11-06_134434.log > 2006-11-06_134434.log.sqr
> Fatal error: exception Not_found
Is it possible that you can send me the CSV file (privately and in
confidence if necessary) and I will take a look at the problem for
you.
Rich.
--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Internet Marketing and AdWords courses - http://merjis.com/courses - NEW!
Merjis blog - http://blog.merjis.com - NEW!
__._,_.___
.
__,_._,___
|
| "ocaml_beginners"::[]
Recompiling csvtool |

|
2006-11-24 09:50:26 |
|
On Fri, Nov 24, 2006 at 09:45:30AM +0000, Richard Jones wrote:
> On Fri, Nov 24, 2006 at 11:05:06AM +0200, Johann Spies wrote:
> > Thanks to Richard for his csv-library.
> >
> > I want to recompile csvtool with ExtLib after I got a stack overflow on my
> > first try on a large file.
>
> This sounds like a bug actually. What csvtool operation were you
> trying to perform?
csvtool namedcol square -i 2006-11-06_134434.log -o 2006-11-06_134434.log.sqr
> Anyway, try version 1.1.3 on the website:
> http://merjis.com/developers/csv
>
Thanks. I will try it.
> You will need to edit the top of Makefile and csv.ml, but it should be
> fairly obvious what to do to get it to link with and use ExtList.
OK. I will try again.
Regards
Johann
--
Johann Spies Telefoon: 021-808 4036
Informasietegnologie, Universiteit van Stellenbosch
"Jesus saith unto him, I am the way, the truth, and the
life; no man cometh unto the Father, but by me."
John 14:6
__._,_.___
.
__,_._,___
|
[1-6]
|
|