Amiekbir Posted March 19, 2013 Share Posted March 19, 2013 (edited) Hi I am new to this forum. And pretty new to auto-it. My friend directed me to here for help.I just want to know how to read from text file and write it according to the order.I want to modify the names in text file as according to my wish.Also no matter whenever i start the script it should start from the last name written until it ends. When it ends if i start the script again it is gonna start from word 1Example text file.word1,word2,word3for word1 write dada,word2-asda etc.Please help! Edited March 19, 2013 by Amiekbir Link to comment Share on other sites More sharing options...
water Posted March 19, 2013 Share Posted March 19, 2013 Welcome to AutoIt and the forum! Can you please tell us why you need to create so many (how many?) Gmail addresses? What do you want to do with this mail accounts? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Amiekbir Posted March 19, 2013 Author Share Posted March 19, 2013 Its just an example. I just wanna learn how to read files into autoit and write accordingly. And get used to know the pixel or id function. Just practice as i am learning. Does not necessarily be creating new accounts. Link to comment Share on other sites More sharing options...
Amiekbir Posted March 19, 2013 Author Share Posted March 19, 2013 Any help would be appreciated. Thanks in advance. I hope i will learn how to do it. Link to comment Share on other sites More sharing options...
water Posted March 19, 2013 Share Posted March 19, 2013 If you just want to learn AutoIt I suggest to read the tutorial section of the Wiki as a start. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Amiekbir Posted March 19, 2013 Author Share Posted March 19, 2013 Read it but could not figure out that part. . Got 7 posts left today anyways lolz. Thanks for the advice. Link to comment Share on other sites More sharing options...
water Posted March 19, 2013 Share Posted March 19, 2013 As a start: Reading files: See function FileReadLine or _FileReadToArray. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Amiekbir Posted March 19, 2013 Author Share Posted March 19, 2013 thanks but how it detects the file path say my text file is in d drive. It will still read it? Link to comment Share on other sites More sharing options...
water Posted March 19, 2013 Share Posted March 19, 2013 You have to specify the file path in the FileReadLine statement. Please check the help file. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Amiekbir Posted March 19, 2013 Author Share Posted March 19, 2013 Figured out the pixel and most of it. Only problem is the reading from a text file. Anyone wanna give me an example please. Link to comment Share on other sites More sharing options...
water Posted March 19, 2013 Share Posted March 19, 2013 The help file has examples at the end of every function. So please search the help file for FileReadLine and scroll down to the end for an example. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Amiekbir Posted March 19, 2013 Author Share Posted March 19, 2013 ok done and now how you make it read the consecutive in the order? Say in a while loop. And i can modify that in word or text file. sad,bad,had dad,take,make. Thanks Water. Link to comment Share on other sites More sharing options...
water Posted March 19, 2013 Share Posted March 19, 2013 To read a file, change the content and then write the file I would use:_FileReadToArrayLoop through the array and change the content as needed_FileWriteFromArray to write the data to a file My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Amiekbir Posted March 19, 2013 Author Share Posted March 19, 2013 Thanks.I read the help file and the examples but harder for me lolz. is it possible to read from one text file while write those words in another text file. Any example script that you can show. I learn more from actual examples or videos. Anyways thank you very much for replying to newbie like me Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 19, 2013 Moderators Share Posted March 19, 2013 Amiekbir,I have lifted the 10 post "New Member" limit for you - it looked as if you were going to bump into it very quickly. However, please take the time to read the Forum rules (there is also a link at bottom right of each page) as asking for an email creation spammer in your first post was not the best way to begin here. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Amiekbir Posted March 19, 2013 Author Share Posted March 19, 2013 oh sorry.....i though that wld be good example. I just wanna learn lolz the 1st example came to me was that.....u can edit it or advice me to change it.Thanks Link to comment Share on other sites More sharing options...
water Posted March 19, 2013 Share Posted March 19, 2013 Sample script to read a whole file to an array, loop through the array and change some content, then write the array to another file:#include <Array.au3> Global $aFileIn _FileReadToArray("path of file to read from goes here", $aFileIn) For $iIndex = 1 To $aFileIn[0] If $aFileIn[$iIndex] = "Old value...." Then $aFileIn[$iIndex] = "New value" Next _FileWriteFromArray("path of file to write to goes here", $aFileIn) Amiekbir 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Amiekbir Posted March 19, 2013 Author Share Posted March 19, 2013 Arigato gozaimas water taicho san . And in the file path _FileReadToArray("path of file to read from goes here")do i type something like A:Autoit Tutorials ? Link to comment Share on other sites More sharing options...
water Posted March 19, 2013 Share Posted March 19, 2013 Yes, insert the whole path to a file you want to read e.g. "C:temptest.txt" My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Amiekbir Posted March 19, 2013 Author Share Posted March 19, 2013 (edited) Ok done but i have one more problem . #include <ImageSearch.au3> sleep (5000) $A= 0 $B= 0 Func Start() $Search = _ImageSearch('Capture.PNG',0,$A,$B,0) If $Search=1 Then MouseMove($A,$B,10) EndIf EndFunc While 1 sleep(100) WEnd Not doing what it shld do. I want to click on that image no matter where it is on desktop.But it is not doing that. One note is i use 64 bit windows 7 home premium. Edited March 19, 2013 by Amiekbir Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now