Jump to content

Rskm

Active Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by Rskm

  1. Hi, i have copied a file to memory using CTRL+C. now, i wish to copy this file to a folder which is user input. How do i access the file in the memory? Basically, what i expect the script to do is as follows. 1. i perform single click on a file on file in a particular folder, say 'new_folder' 2. when i run the autoit script, it activates the 'new_folder' and then performs CTRL+C, which will by default copy the file to memory as i have clicked it before running the script 3. in the next step, this file should be copied to a different location. appreciate any idea on this.
  2. Hi, i wish to write a script which can mesh an area in autocad file and then calculate the required section properties. i know full version autocad has the option region>massprop. But i wish to develop this script, so i can get the property in demo cad version too. The link below describes the effort in python, my programming skill is limited to FORTRAN and auto it. so, i wish to know if there are MeshPy equivalents in autoit. Any suggestions are welcome.. thanks https://newtonexcelbach.com/2017/12/09/section-properties-with-meshpy-including-torsion-and-warping/
  3. User is given the compiled EXE only.
  4. Hi, for a script of mine, I wish to keep a time frame on till how the program will work.. basically, I want the program to read the date and if the read date < 'a particular date', the program continues, else it exit. I don't want to read the time from the computer as the program can be fooled by resetting the pc time. is there a way to read time from internet - so that the user cannot fool the program by date reset? thanks
  5. @jchd, i was taking a simple example with stringformat. All i want is that the cells should be occupied with zero if sufficient digits are not actually present in the number.. assuming 7 columns dedicated for printing, i expect 123.568 to be printed as 0123.57 and -1.2 to be printed as -001.20
  6. Hi , i am not able to fill in '0's ahead.. $num=1234.5656565 stringformat("%5.2f",$num) gives output as 1234.57, i need the result as 01234.57
  7. Hi, i have a variable (floating number - could be positive or negative), i wish to print it into a text file, how can i keep the format in such a way that it always has 4 digits ahead of decimal and 2 after decimal basically i have total 7 columns in the text file to print the variable ; eg: variable = 1.235, output requied = 0001.24 variable=-23.55555, output required =-023.56
  8. @Jos, Sorry for posting on wrong window @ModemJunki, that really helped me. I was trying a lot with stringtrim and other options.. that piece of code just nailed it.. thanks a lot
  9. Hi, I have the following line in a text file 'input.txt'. I know the line number - say '6'. I wish to replace the text 'WWW' in the below line with a random number (I can generate that with random()). WERIS WWWJP 3.83 8.330 1.000 1097.RAXX The WWW is a 3 digit integer (could be any number between 0 to 999), I can use stringtrimleft and get the numerical value of WWW in this file so, basically, I know the string to replace (ie; WWW stored in a variable), I know the line number to work on and the file location/name and the replacement variable (through random()). My requirement is to fill that 3 spaces with my random number (which Is a integer between 1 and 999) please put ur suggestions
  10. _Excel_ColumnToLetter ( $iColumn ) - this was good enough..
  11. Hello JLogan, thanks for the initiative, the above example you mentioned prints output in column A, ie; in cells A1, A2, A3 till A20... what i need is to print the 20 elements in rows ie; A1, B1, C1 .... T1
  12. hi, i am using commands like the below to print values to excel, the array has 20 values, do i have to manually type as a1, b1, c1, d1.... till t1 or is there a short cut(loop) by which i can get the 20 elements printed in a particular row(here row 1) of excel? _Excel_RangeWrite($oWorkbook, 1, $array[1], "a1") _Excel_RangeWrite($oWorkbook, 1, $array[2], "b1") _Excel_RangeWrite($oWorkbook, 1, $array[3], "c1") thanks
  13. hi, i have the following function to get a number in scientific format. my input is 12360 what i get using the below function = 1.236E+004 What i require is 1.236E4 how do i achieve this. i do not require the '+00'prefixing '4 or whatever' in my o/p. Func _FXTY($inumber) return stringformat("%01.3E",$inumber) Endfunc
  14. i didnt know why it was not working for a while.. for some reason, its all ok now without change in the code
  15. i have a code where the ControlSetText was working perfectly. now its not working. please see the video and snap attached. The snap show the way i have used window info. In the video, when the dialogue box opens, it used to key in 'sea.runx' , but now its not working so... what could be the reason. the script used is as shown below - thanks WinActivate("SACS 5.3 V8i") winwaitactive("SACS 5.3 V8i") send("^r") winwaitactive("SACS Run Files") ControlSetText ("SACS Run Files","",1148,"sea.runx") SEND("{ENTER}")2018-03-22 at 00-02-47.mp4
  16. thanks melba23,brewmanNH for the suggestion.. i am new with autoit.. how do i make sure the array is created ? sleep option will work - so that i put sufficient time before/after reading the array.. this error does not happen always, so i cannot check it manually for each iterations - how to ensure that the array is created.. thanks again
  17. i have seen many pointing out issues related to this, i tried reading through them - still unable to solve mine.. i have a script which reads certain lines based on a search item, this is an iterative process - the ldflst_file gets updated for each iteration and the script finds the line number which has the search item. this works perfectly for few iterations, but stops in some cases abruptly with the error = Subscript used on non-accessible variable $aRead^ ERROR I have verified that the search item is present in the file. what could be the reason for this code to stop in certain cases. thanks for help my code below (partial).. full code is in attachment local $aRead=FileReadToArray($ldflst_file) global $ldflst_var1=" JOINT LOAD FORCE(X) FORCE(Y) FORCE(Z) MOMENT(X) MOMENT(Y) MOMENT(Z)" for $i= 0 to $ldflst_totlines ; ldflst_totlines is total number of lines in the file 'ldflst_file' if $aRead[$i]=$ldflst_var1 Then $ldflst_LFound=$i ExitLoop else EndIf Next nomo_new1.au3
  18. Hi, I wrote the below code to learn user defined functions.. jam is the function which calculates summation and division of two numbers $a, $b.. I expect the $sum and $div receives the results $r and $s respectively from the function... but the msbox in the main program doesn't display results properly, while the one inside func shows it correclty. how do I pull the values in $r and $s to $sum and $div respectively.. thanks for all the help on this forum global $a,$b,$sum,$div $a=1 $b=2 jam($a,$b,$sum,$div) msgbox(0,"results",$sum&" , "&$div) func jam($p,$q,$r,$s ) $r=$p+$q $s = $p/$q msgbox(0,"results",$r&" , "&$s) EndFunc
  19. hi, they are spaces..
  20. I have a text file with lot of lines (of the order of 30000 - thats to get an idea about the size of file). i wish to replace particular texts , and wish to do the search based on the 'start' and 'end' of such lines , because the 'in between' portions are variables and they vary. the texts in the file looks like below CAD 100 101 102 E NEW REPLACE SOME TEXT HERE SOME TEXT HERE SOME TEXT HERE SOME TEXT HERE SOME TEXT HERE SOME TEXT HERE SOME TEXT HERE SOME TEXT HERE CAD 200 201 202 R CHK REPLACE SOME TEXT HERE SOME TEXT HERE SOME TEXT HERE CAD 300 301 302 E FEW REPLACE SOME TEXT HERE SOME TEXT HERE SOME TEXT HERE SOME TEXT HERE SOME TEXT HERE SOME TEXT HERE SOME TEXT HERE CAD 400 401 402 G COK REPLACE SOME TEXT HERE SOME TEXT HERE SOME TEXT HERE SOME TEXT HERE What i want to replace is only the lines which start with 'CAD' and end with 'REPLACE' in the text, the replacements are respectively CAD 600 111 112 E NEW REPLACE CAD 700 222 223 E NEW REPLACE CAD 800 333 334 E NEW REPLACE CAD 900 444 445 E NEW REPLACE my replace should look something like replace ("CAD 100 $var1 $var2 $var3 $var 4 "REPLACE") with ("CAD 100 $newvar1 $newvar2 $newvar3 $newvar 4 "REPLACE") where $var1,2,3,4 represents 100,102,E and NEW and $newvars are the replacements. thanks.
×
×
  • Create New...