Sign in to follow this  
Followers 0
Guest dubrave

Need help with ClipPut

3 posts in this topic

Hi ppl.

Love Autoit, congrats, very strait forward and powerful.

I have a problem, but...

I am trying to copy the content of a .txt file to the clipboard.

Using ClipPut, I only manage to push one line at a time, so the result is the last line of text being left in the clipboard.

Is there a way to copy the file content without opening it???

Any help would be appreciated.

Dubrave

Share this post


Link to post
Share on other sites



Hi ppl.

Love Autoit, congrats, very strait forward and powerful.

I have a problem, but...

I am trying to copy the content of a .txt file to the clipboard.

Using ClipPut, I only manage to push one line at a time, so the result is the last line of text being left in the clipboard.

Is there a way to copy the file content without opening it???

Any help would be appreciated.

Dubrave

<{POST_SNAPBACK}>

clipPut("line1" & @lf & "line2")

or

clipPut("line1" & @crlf & "line2")

is not working for you?

Share this post


Link to post
Share on other sites

clipPut("line1" & @lf & "line2")

or

clipPut("line1" & @crlf & "line2")

is not working for you?

<{POST_SNAPBACK}>

I prefer arrays and the like for file operations.

#include <file.au3>
Dim $file,$filearray,$x,$line
$file = FileOpen(C:\blah.txt,0)
   If @error = -1 then exit
_FileReadToArray($file,$filearray)
For $x = 1 to $filearray[0]
   $line = $line & @CRLF & $filearray[$x]
Next
ClipPut($line)

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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