(Edited from original. Please note that I AM NOT AN AUTOIT EXPERT. I write code using Autoit frequently but I am no expert, especially when it comes to I/O. So any remarks that start with "Why did you..." can be answered by referring to the first sentence. This project was done in Autoit because of an interface I built to display the data.)
Attached is a program and ascii input file I wrote to read stock price data, convert it to binary and then read it back into the program in binary. The goal was to show increased performance for reading the files in binary and provide a demo on how to read/write binary for int32, int64, double and strings for anyone who might find it helpful. The results on my PC show the following:
Time to read ascii file only: 456.981951167202
Ascii read & process time: 6061.83075631701
Binary write file time: 14787.9184635239
Time just to read binary file: 42.418867292311
Binary read and process time: 4515.16129830537
A couple things to note:
1) The 32 MB ascii file took 10x longer to read than the 15 MB binary file. Not entirely sure why. Both were read into a buffer.
2) The Binary write takes a long time but I made no effort to optimize this because the plan was to write this file one time only so I don't mind if it takes longer to write this file. I care much more about how long it takes to read the file because I will be reading it many times.
3) There was a modest gain in converting the ascii file to binary in terms of file size and reading speed.
So big picture... not sure it's worth the effort to convert the files to binary even though most of the data is numerical data in the binary file. That was actually surprising as I expected there would be more of a difference. Any ideas on how to get the binary data to read at a faster rate would be great.
I found a PowerShell module in the TechNet script center that will be useful to me for detecting reboots; however, my knowledge of PowerShell is limited and I don't know how to load the a module for use with my AutoIt scripts. (in case you need it): https://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542)
I loaded the PowerShell module successfully manually via the PowerShell ISE on my test machine, and ran a batch command successfully on it too. NOTE: I sometimes use a batch file commands for troubleshooting a few lines of code and then I convert the "known good" command into my final AutoIt scripts).
As I mentioned, I ran the following batch command-line successfully after I had manually loaded the Powershell module via the ISE (the command displays a "True" or "False" in the Windows CMD console - see the attachment) :
PowerShell -Command (Test-PendingReboot -SkipConfigurationManagerClientCheck).IsRebootPending I need to know how I can include the PowerShell module in a subfolder and load it, in addition to running the command-line mentioned above. I have used *.PS1 scripts before in my AutoIt projects, but my general knowledge of Powershell is limited and I don't know how to work with modules. Can anyone with some Powershell knowledge help me with these few lines of code needed to accomplish the goal?
I would appreciate any help you can offer.
Here is a simple program that some of you might appreciate.
It is a more full fleshed out version of something I worked on a while back as a proof of concept.
I will just quote the information found in the Program Information dialog.
INItoSQL DB v1.1.zip (see Post #3 for update details)
INItoSQL DB v1.4.zip (see Post #4 for update details)
INItoSQL DB v1.6.zip (see Post #7 for update details) BIG THANKS to ResNullius for huge speed improvement etc.
Program requires the sqlite3.dll, not included, but easily enough obtained.
I have also included the beginnings of a new UDF (SimpleSQL_UDF) I am working, which you can use with the included 'Check conversion.au3' file to check a resulting conversion ... just modify the values for a few variables to suit your situation.
I've not yet gotten around to coding a testing/checking results script, so I recommend the following open source program, which I have been using for some time. It was here, but is now here at GitHub - DB Browser for SQLite
I'm trying to read a binary file to an array but couln't get it to work.
Also I coul not find any help in the forum around this subject whish was helpfull.
Is there any way it could be done?
I tried a lot of ways but maybe somebody know's the right way?
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <File.au3> #include <Array.au3> #include <AutoItConstants.au3> Local $in=FileOpen("TEST_labels.idx1-ubyte",16) ; 16+0=Read binary Local $data = FileRead($in) Local $FileArray = BinaryToString($data,4) ;~ $FileArray = StringSplit($BinarydData, @CRLF, 1+2) ;~ Local $FileArray = StringRegExp($BinarydData, "[^\r\n]+", 3) FileClose($in) _ArrayDisplay($FileArray,"$FileArray","",32) MsgBox($MB_SYSTEMMODAL, "", "$FileArray = " & $FileArray )