Author Topic: Redirecting into an SE editing buffer (e.g. "dir | vs")  (Read 4322 times)

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Redirecting into an SE editing buffer (e.g. "dir | vs")
« on: March 29, 2008, 09:42:15 PM »
How can I get SE to read stdin and put it in a buffer?
Some examples:
  • dir | vs
  • p4 changes -l | vs
  • foo | perl -pe"some_regex" | vs

I'm used to doing this with the editor I had been using before SE, and I'd like to be able to continue doing this, but I can't find any relevant topics in the Help file (searched for "stdin", "standard input", got no relevant hits).  I realize I can write a shim executable to write its stdin to a temporary file and then launch SE on the temporary file, but it would be nicer to have native support.

LBCEi

  • Senior Community Member
  • Posts: 266
  • Hero Points: 21
Re: Redirecting into an SE editing buffer (e.g. "dir | vs")
« Reply #1 on: March 29, 2008, 10:53:11 PM »
I know of one way to achieve this (though it takes a few steps).  

1. Open the Build toolbar (a.k.a. the process buffer).
2. Enter your desired command (e.g., 'dir')
3. Right click in the Build toolbar window and select 'Send Compile Output to Editor Window'.

This will create a buffer called "Build (.process)" containing the output of your command.

I hope this helps (there are likely better/simpler ways to do this but I'm no expert).

Regards
Les

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Redirecting into an SE editing buffer (e.g. "dir | vs")
« Reply #2 on: March 31, 2008, 02:10:51 PM »
I've used Filter Selection (Edit > Other > Filter Selection... or filter_command) to do something like that.  It makes a temporary file of the current selection as input file and output is redirected to another temp file (cmd < in.tmp > out.tmp), and then the output temp file is read into the current selection, clean-up of temp files is done automatically.  You can create a new empty file, create a line selection on Line 1, and call filter-command with the external cmd, and you should get results as long the cmd doesn't care about getting an empty line as redirected input.  It's not exactly what you want, but it should be close enough.