Re: Combining Query Outputs



Lucy,

Yes, just put the commands you want ("copy", etc.) into a text file, save it with an extension of "BAT", such as "Sortem.bat", and invoke it by writing a Macro with a RunApp action that runs your *.BAT file.

  -- Vincent Johns <vjohns@xxxxxxxxxxxxxxxxxx>
  Please feel free to quote anything I say here.

Lucy wrote:

Thanks so much Vincent! :) It works like a charm!
Do you know if there is a way to run this command-line out of access? Eg. by using a macro?


Thanks again for all your help!

"Vincent Johns" wrote:


Lucy,

To combine them, you could use the command-line commands

  copy file1.txt + file2.txt + file3.txt unsorted.txt
  sort <unsorted.txt >sorted.txt
  del unsorted.txt

to do it, where your 3 files are file1.txt, file2.txt, and file3.txt, and your final sorted output is to go to the file "sorted.txt".

Be sure to use file names (instead of "unsorted.txt" and "sorted.txt") that aren't already in use for real files in the folder you're using.

Or you could use Notepad to combine them, if they're not too large, by opening each one in Notepad and copying the entire contents to another file in Notepad, then saving the result.

I don't know what you mean by "the data is wrapped". If you're using Notepad, you can unwrap the lines by clicking on Format and de-checking the "Word Wrap" option. That won't change the contents of the file, but will change how they appear in the Notepad window.

  -- Vincent Johns <vjohns@xxxxxxxxxxxxxxxxxx>
  Please feel free to quote anything I say here.

Lucy wrote:


Hi Vincent,

Thanks so much for the reply.
Each of the 3 queries have their own different, specific file layout that I am currently exporting to 3 different text files. Is there a way to export each of them and then append them to the same text file?
Also, when I export the data from 2 of the files, the data is wrapped, do you know if there is a way to avoid this?


Thanks so much for your help Vincent.

"Lucy" wrote:



Hi,

I have 3 queries that have totally different field outputs.
Once I have run each of these 3 queries, I would like to combine their output in one file. Their output would be on different lines, the ouput of query 1 in the first couple of lines, followed by the output of the second query on the following lines etc. but all included in one file . Is there a way to do this?


Thanks in advance for your help.

.



Relevant Pages

  • Re: Cant change shortcut icon
    ... Click Start> Run> CMd> Click OK ... Type these commands one/by/one then Enter after each: ... Then post the contents of notepad window... ... directory name or volume label syntax is incorrect ...
    (microsoft.public.windowsxp.general)
  • Re: Cant change shortcut icon
    ... Type these commands one/by/one then Enter after each: ... Then post the contents of notepad window... ... directory name or volume label syntax is incorrect ...
    (microsoft.public.windowsxp.general)
  • Re: autoexec.nt repair
    ... At the command prompt, type the following commands, pressing ENTER ... In Notepad, type the following entries: ... type the following entries: ... Right-click the %SYSTEMROOT%\System32 folder, and then click ...
    (microsoft.public.windowsxp.general)
  • Re: Cant change shortcut icon
    ... Type these commands one/by/one then Enter after each: ... Then post the contents of notepad window... ... reg is not recognised as an internal or external command, operable program or batch file ...
    (microsoft.public.windowsxp.general)
  • Interaction command and functions (tutorial)
    ... commands and methods that were available in Visual Basic like ... The shell function runs an executable program, ... AppActivate("Untitled - Notepad") ...
    (microsoft.public.dotnet.languages.vb)