View Single Post
Old 08-13-2008   #2 (permalink)
Al Dunbar


 
 

Re: I 'm looking for a compiler ...


"threp" <threp@xxxxxx> wrote in message
news:48a3573f$0$3218$426a74cc@xxxxxx
Quote:

> Hi,
> 1. I'm looking for the fastest way to open a CSV file that is full of
> quotes, zap all the quotes, and then close it.
A script is likely not going to give you the fastest method. I'd suggest
writing this in a compiled language instead.

Of course, this also depends on what you mean by "zapping" all the quotes.
Like, do you have a mosquito zapper that you think will do the job for you?

If "zap" simply means remove or delete, then you could write a script that:

- reads in the entire file (using .readall);
- changes all instances of a double quote character to a zero-length string;
- writes the file back out.

But are you sure the result would always be a valid csv file? If it
contained a line like this:

"test","comma next",",","done"

having four elements, stripping out the double quotes would give:

test,comma next,,,done

which clearly has five elements.
Quote:

> 2. I 'm also looking for a compiler to make that script into an exe file .
> The exe would need to grab a filename from the command line.
There have been attempts at creating a compiler for an existing scripting
language, but, imho, the result is not optimal, and often problematic. It
also depends on the language used. I'd suggest you go straight to a compiled
language from the start if blistering speed is your requirement.

/Al


My System SpecsSystem Spec