Jump to content

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


Wollf
 Share

Recommended Posts

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

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!

Link to comment
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)

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...