How to copy the content of text files without opening files?

Discuss and share scripts and script files...
Post Reply
paul0
Posts: 137
Joined: 23 Oct 2009 19:26

How to copy the content of text files without opening files?

Post by paul0 »

I am just curious about how to copy the content of text files to an editor without opening files :?:

Your advice will be appreciated. 8)

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: How to copy the content of text files without opening fi

Post by Filehero »

paul0 wrote:I am just curious about how to copy the content of text files to an editor without opening files :?:
Oxymoron? Technically, files have to be opened to access their content for copy.

Usually a text editor is used for manual editing. So, I wonder why you just don't use the "open"-command?


Cheers,
Filehero

paul0
Posts: 137
Joined: 23 Oct 2009 19:26

Re: How to copy the content of text files without opening fi

Post by paul0 »

Sometimes, I just copy some content for editing and keep the original file intact. The way doesn't require to backup the file either.

XYplorer is VERY powerful. :lol: I started to be a little lazy....

Slavaon
Posts: 158
Joined: 29 Mar 2012 07:35

Re: How to copy the content of text files without opening fi

Post by Slavaon »

Use InfoTip Extension 2.0.4.106 (License free)
“If you press the following keys when InfoTip is shown, the InfoTip content
will be copied to the clipboard.
[Ctrl] key -> File's full path text.
[Shift] key -> content text.”
Windows all, the seventh х64 too

paul0
Posts: 137
Joined: 23 Oct 2009 19:26

Re: How to copy the content of text files without opening fi

Post by paul0 »

Slavaon wrote:Use InfoTip Extension 2.0.4.106 (License free)
“If you press the following keys when InfoTip is shown, the InfoTip content
will be copied to the clipboard.
[Ctrl] key -> File's full path text.
[Shift] key -> content text.”
Windows all, the seventh х64 too
Thanks for sharing.

I use another similar tool called FileMenu.

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: How to copy the content of text files without opening fi

Post by Filehero »

paul0 wrote:Sometimes, I just copy some content for editing and keep the original file intact. The way doesn't require to backup the file either.
Copy your file first (e. g. to a temp folder), and then call open(). Simple as that.


Cheers,
Filehero

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: How to copy the content of text files without opening fi

Post by Stefan »

paul0 wrote:I am just curious about how to copy the content of text files to an editor without opening files :?:
Maybe make an temp copy of that file first?

like:

Code: Select all

  if (get("CountSelected") == 1) { 
   
    //user settings:
       $file = "<curname>"; 
       $temp = "%temp%\xy";
       $copy = "COPY_$file";
  
  
    //code:
      copyitem $file, "$temp\$copy"; 
      run notepad "$temp\$copy";
      //delete [recycle=1], [confirm], [itemlist]
      delete 1, 1, "$temp\$copy";
  
  
  }else{ 
        msg "Please select ONE file only!":
  }

paul0
Posts: 137
Joined: 23 Oct 2009 19:26

Re: How to copy the content of text files without opening fi

Post by paul0 »

Stefan wrote: Maybe make an temp copy of that file first?
Thanks, Stefan. This is a perfect solution. :appl:

aimy
Posts: 182
Joined: 26 Feb 2007 15:44

Re: How to copy the content of text files without opening fi

Post by aimy »

XYplorer 11.40.0100

Why I got this error?
2012-07-09_152035.gif
2012-07-09_152035.gif (18.35 KiB) Viewed 3123 times
Thank you.

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: How to copy the content of text files without opening fi

Post by highend »

Any info on when you get it, on which operation, using a script or not, etc., etc., etc....
One of my scripts helped you out? Please donate via Paypal

aimy
Posts: 182
Joined: 26 Feb 2007 15:44

Re: How to copy the content of text files without opening fi

Post by aimy »

highend wrote:Any info on when you get it, on which operation, using a script or not, etc., etc., etc....
I assigned the above script by Stephan to the user button.

I click on one text file, then click that user button.

Then the error comes.


Thank you.

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: How to copy the content of text files without opening fi

Post by highend »

Unable to reproduce with a simple text file an Stefan's script...
v11.40.0005
One of my scripts helped you out? Please donate via Paypal

Post Reply