Jump to content

badeend

Members
  • Posts

    12
  • Joined

  • Last visited

Recent Profile Visitors

98 profile views

badeend's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hi, First of all thanks for your effort! I need the text like you got with original. ELIM:3 etc are parts of a .CSV-type of file. When i run your code I get the binary when i execute the code. I also tried the binary to string function but this gives me : FCFBLK So the first word of the file but nothing else.
  2. #include <array.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> Local Const $sFilePath = "example.edf" ; Open the file for reading and store the handle to a variable. Local $hFileOpen = FileOpen($sFilePath, $FO_READ + $FO_FULLFILE_DETECT ) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.") EndIf ; Read the contents of the file using the handle returned by FileOpen. Local $sFileRead = FileRead($hFileOpen) ; Close the handle returned by FileOpen. FileClose($hFileOpen) ; Display the contents of the file. MsgBox($MB_SYSTEMMODAL, "", "Contents of the file:" & @CRLF & $sFileRead) ConsoleWrite($sFileRead) If i try this i get 2 different results. The msgbox and the consolewrite are different...
  3. Thanks for your help! I tried both codes. The first worked for me. Still have a problem with the file though. If i use the nonmodified code i get a bunch of numbers (so not the text from the file) if i modify it so that it writes to console i get the text file with a bunch of NULL in between. Why is this different? If i try to split the string by ":" i get nothing even though it contains a lot of ":". Thanks again,
  4. Hi, I have written this code in order to read a text based file with extension .EDF. It was possible to do this in the past but now i get no output if i use _Filereadtoarray and if i use filereadline the program does not stop. The .edf is text based. And in the past i was able to read it (with vba and not autoit). Is there something different in how autoit reads the text that it can not use it? Or am i just an idiot and is my code of? I attached an example of the file. I have 10000 of these i would like to read and parse. Thanks for you help! #include <File.au3> #include <Array.au3> Local $sFilePath = "\\nippon.be\VDIUserFolders\verheja\Desktop\st\example.edf" ;local $vReturn ;Local $test = _FileReadToArray ( $sFilePath, $vReturn,4,@CRLF) local $file = FileOpen($sFilePath,16384) ;_ArrayDisplay($vReturn) ;MsgBox(0,0,"") ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop ConsoleWrite( $line) Wend example.edf
  5. Thanks, i'll look in to it. Problem is that i would like to move away from excel. I would like to make the chart in autoit and get the data directly from our sqlserver. The problem is that i'm not so good at autoit so i would like to make each part individually to see if i can do it and if so create the whole program. Thanks for your response!
  6. Hi, I'm trying to create a graphic with a time axis from an excel file. I had to change the times to timepassed in seconds because otherwise i could not get the graphic to plot like i wanted. This could work on a cleaner way but i can't fix it. The big question i'm having is if i can get the handle from the lines i plot so that when i plot (for example) 8 i can select which ones i can show on the graph. Or is the only way to do this plot the graphic again every time with the lines that i want to visualize. The excel contains the following data for now : column 1: value1 to be plotted column2: date of all the values column3: empty (i use this in my code) column4: value2 to be plotted 1143,186 2018-02-08 23:13:21,000 15,12461 I added my code after this. Thanks for any help!!
  7. Hi, Anyone can help me to use time and date as labels for the x-axis? Can't get it to work. Thanks!
  8. First of all, thanks for the quick response from all you guys! The writing works now. So also thanks for that. I have a new question, actually a few. 1. The @error, how can i see the values this thing gives? For example: @error:1 - File is read-only 2 - Unable to open the file 3 - Unable to write to the file2. consolewrite: Same question really. It writes data to the STDOUT stream. But that does not teatch me much :). 3. I would like to check my test array1 for all the possible values of another array2. How would i go about doing that? I was thinking something along the lines of: Load first value of array2, search array 1, make array of results in new array Load second value of array 2,..., make new column in results array with results and so on. Or is there a better way to do this? 4. Lastly, if i want to use a value from an array all i need to do is type: local $value= array(1) right? Because i keep on getting that the value is badly formatted (if i use []) and that the variable can't be accessed in this manner. Any tips on things to read on arrays are more than welcome. I read the wikipage allready but i think i need a bit more for what i'm doing. Kind regards!
  9. Hi, I'm pretty new at autoit. I'm coding a bit to learn it. I am trying now to read an array and write it back to a file so i can verify it works. This is my code: #include <GUIConstants.au3> #include <string.au3> #include <File.au3> $path = "1" $file = FileOpen("c:\test.csv", 0) $file2 = FileOpen("c:\rekeningnrs.txt", 0) $file3 = FileOpen("c:\output.txt", 0) global $vReturn[3] ;_FileReadToArray ( $file2, $vReturn ) ; _FileWriteFromArray($file3, $vReturn) ; Sleep(1000) ;MsgBox(0,$vReturn(1)) _FileReadToArray($file2, $vReturn, $FRTA_NOCOUNT, ";") If IsArray($vReturn) Then MsgBox(0, "hoera!", "hoera!") EndIf _FileWriteFromArray("c:\output.txt", $vReturn,1) ; Display the file. ShellExecute("$file3") The "hoera" part is to show it works. The write from array does not generate an output. The txt file stays empty. Any thoughts? Kind regards
  10. Hi, For the past couple of months i've been trying to write a program using autoit. I'm convinced it is not that mutch work. But since i'm a total noob at programming i would like to pay someone for writing it for me. I am convinced that in the end i would be able to write it (so it has to be peanuts for you guys) but it just takes to long for me to get it done. We can determine the price after i give you the details, which i would rather not do on the forum. Don't worry it's nothing illegal. Let me know if someone is interested and delete my post if this is not allowed. I am also willing to contribute to the forum if that is wat the guy who writes the code wants. Thanks!
×
×
  • Create New...