![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | I 'm looking for a compiler ... 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. 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. Any ideas ? TIA Threp |
My System Specs![]() |
| | #2 (permalink) |
| | 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. 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. 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 Specs![]() |
| | #3 (permalink) |
| | Re: I 'm looking for a compiler ... threp wrote: 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. > 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. > > Any ideas ? 'Usage: cscript /nologo NoQuotes.vbs path_to\YourFile.cvs Set objArgs = WScript.Arguments If objArgs.Count = 0 Then Wscript.Quit filename = objArgs(0) Const ForReading = 1, ForWriting = 2 Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile (filename, ForReading, True) txt = f.ReadAll Set f = fso.OpenTextFile (filename, ForWriting, True) f.Write Replace(txt, Chr(34), "") f.Close Sorry, can not help with item 2. -- Todd Vargo (Post questions to group only. Remove "z" to email personal messages) |
My System Specs![]() |
| | #4 (permalink) |
| | 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. Option Explicit Const cCSV = "noquotes.csv" Dim intCSV : intCSV = 0 Dim strCSV Dim objFSO Set objFSO = CreateObject("Scripting.FileSystemObject") strCSV = objFSO.OpenTextFile(cCSV,1). ReadAll intCSV = Len(strCSV) strCSV = Replace(strCSV,Chr(34),"") objFSO.OpenTextFile(cCSV,2,True).Write(strCSV) Set objFSO = Nothing WScript.Echo intCSV - Len(strCSV) & " quotes removed." 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. |
My System Specs![]() |
| | #5 (permalink) |
| | Re: I 'm looking for a compiler ... threp wrote: 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. > If you have vb (classic), then you could insert that code and compile it to an exe. As for the newer vb (vb.net) you could also use that, although it is a bit more complicated. As far as the other suggestions you will get here, (autoit, vbs2exe, etc), those are not really "compilers", they are more accurately characterized as "wrappers". What they do is wrap (bundle) up your script with the runtimes into an exe file. So, while it looks like an exe, it is really only an exe startup module which will then just run your script in the background. For all practical purposes, this may be a distinction without a difference. So if all you want is an exe, there are lots of ways to get there. cheers, jw ____________________________________________________________ You got questions? WE GOT ANSWERS!!! ..(but, no guarantee the answers will be applicable to the questions) |
My System Specs![]() |
| | #6 (permalink) |
| | Re: I 'm looking for a compiler ... "mr_unreliable" <kindlyReplyToNewsgroup@xxxxxx> wrote in message news:%23AUY73i$IHA.3396@xxxxxx Quote: > threp wrote: 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. >> > and compile it to an exe. As for the newer vb (vb.net) > you could also use that, although it is a bit more > complicated. message you posted a few years ago: http://groups.google.com/group/micro...989e0ac0b80e3c |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Command line compiler | .NET General | |||
| VB Commandline compiler references | .NET General | |||
| C Compiler | Software | |||
| Compiler Provider Options | .NET General | |||