Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having trouble Windows command line SORT via SHELL
#2
(08-24-2023, 02:42 PM)GTC Wrote: My program generates 12 output files that then need to be sorted, and I'd rather do those sorts from within the app (via SHELL) than have to use SORT standalone from the command line afterwards.

Here's an example of how I'm calling it:

Sort_Command$ = "SORT " + "x.x" + " >> " + "y.y"
SHELL Sort_Command$

If I type that sort command on the command line I get y.y as a sorted version of x.x ... which is desired.

However when executed via SHELL a message flashes up in the output window (too fast to read before a blank window replaces it), and no sort occurs.

I have used SHELL previously with other commands and experienced no problems.

Is there a way of directing the contents of the output window to a file, so that I can read whatever is being shown on that?
Just off the top of my head:

- Make sure the SORT command is in the same folder as program's executable, the SORT command's location is included in your PATH, or you are supplying the path to the SORT command in your executable.

- Try using "Start SORT ..." instead.

- Create a batch file (.BAT) and try calling the batch file instead.

- Make sure your spacing is correct within your build string. You might need a space preceding y.y ( " y.y" ) ( update: I see you did that with " >> " )
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply


Messages In This Thread
RE: Having trouble Windows command line SORT via SHELL - by TerryRitchie - 08-24-2023, 02:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to sort negative and positive values ? Jack 16 666 02-23-2026, 02:18 AM
Last Post: Pete
  code locks up when SHELL paulel 4 289 02-15-2026, 08:04 PM
Last Post: madscijr
  trouble filling in a closed vector shape madscijr 31 2,530 11-11-2025, 03:41 PM
Last Post: bplus
  Command$(count%) - I can't get a value when using the optional argument "(count%)" Unatic 3 529 08-22-2025, 11:58 AM
Last Post: Unatic
  keyword to get the EXE name and the EXE path instead of parsing Command$(0) ? madscijr 8 1,158 07-22-2025, 08:35 PM
Last Post: hsiangch_ong

Forum Jump:


Users browsing this thread: 1 Guest(s)