Wollf Posted September 15, 2009 Share Posted September 15, 2009 i want to open a file that it isnt a txt but can be opened by notepad as txt. i want to copy some specific lines from that file and put them in a new txt file. So i was thinnking i could use ctrl-f to find line then ctrlc and then ctrlv to paste it on the txt file. But i have some questions how i open a file with notepad if it isnt a txt file? is there any better way do it than ctrl/f/c/v? how can i do it without opening any notepad windows?? so it is done on the background without the need to see anything and it can work while i do some other things so it isnt affected by the keys i press? Link to comment Share on other sites More sharing options...
jvanegmond Posted September 15, 2009 Share Posted September 15, 2009 Notepad is a very simple program and it is very easy to create a AutoIt script that does the same as Notepad; Without the window. Some functions that are going to help: FileRead ; ( to read the entire file in one go ) StringSplit ; ( To split the file into lines ) StringInStr ; ( To find a string in the read file, or in the split file ) FileWrite ; ( To put output back ) Good luck! github.com/jvanegmond Link to comment Share on other sites More sharing options...
Wollf Posted September 15, 2009 Author Share Posted September 15, 2009 Notepad is a very simple program and it is very easy to create a AutoIt script that does the same as Notepad; Without the window. Some functions that are going to help: FileRead ; ( to read the entire file in one go ) StringSplit ; ( To split the file into lines ) StringInStr ; ( To find a string in the read file, or in the split file ) FileWrite ; ( To put output back ) Good luck! thanks for the anwer, cuz i dont have a lot of free time can u say me how exactly i ll need to do it?? use fileread to take text from the file, then, could you make me a working example? with an example i can easily and fast understand and reproduce it $file1=fileread("file.3ds") $22=StringSplit($file1) StringInStr($22,"the words i want to find",0) $file2=text.txt filewrite($file1,$22) Link to comment Share on other sites More sharing options...
jvanegmond Posted September 15, 2009 Share Posted September 15, 2009 If you don't have time to write a script, you should hire a programmer to do it for you. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Wollf Posted September 15, 2009 Author Share Posted September 15, 2009 ok then how can i open a non txt file with notepad cuz i ll use ctrl/f/c/v to make it? Link to comment Share on other sites More sharing options...
omikron48 Posted September 15, 2009 Share Posted September 15, 2009 (edited) Just use FileOpen and FileRead or FileReadLine to process the text file. Look it up in the help file. It has all the info you need. If you have time to post in and look up the boards, you have time to read a well organized help file. Edited September 15, 2009 by omikron48 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