Sign in to follow this  
Followers 0
Wollf

ctrl-f/c/v how to copy a line from a notepad opened file?

6 posts in this topic

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?

Share this post


Link to post
Share on other sites



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!

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

ok then how can i open a non txt file with notepad cuz i ll use ctrl/f/c/v to make it?

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by omikron48

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0