Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Deleting Unnecessary Lines

Discussion in 'Information Technology' started by Jay, Jul 28, 2006.

  1. Jay

    Jay
    Expand Collapse
    Guest

    Thanks in Advance

    Below is my small procedure that runs a query named as "Test" and puts the
    query result into a destination path with a date appeneded at the end of file
    named asTimeStamp. The output has unnecessary lines and unwanted headings,
    shown below.

    ------------------------------------------------------------------
    Code | Start Time | Duration |
    -----------------------------------------------------------------------
    | 00 | 0805 | 0857 |
    -----------------------------------------------------------------------
    | 00 | 0818 | 0858 |
    -----------------------------------------------------------------------
    (Help) How can I delete headings and unnecessary lines with only comma as a
    record delimiter.
    In short, I want to achieve the following format.

    00,0805,0857
    00,0818,0858

    (Code)
    Dim Qry_Regular As String
    Dim Path As String

    Qry_Regular = "Test"
    Path = "C:\\...\TimeStamp" & Format(Date, "mmm-dd-yyyy") & ".txt"

    DoCmd.OutputTo acOutputQuery, Qry_CPLYT_Regular, acFormatTXT, Path
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Is Mahesh Bhatt considering deleting Meera's controversial kissing ... Breaking News Mar 4, 2005

  3. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Wed, 14 Jun 2006 19:43:01 -0700, Jay
    <Jay@discussions.microsoft.com> wrote:


    >Dim Qry_Regular As String
    >Dim Path As String
    >
    > Qry_Regular = "Test"
    > Path = "C:\\...\TimeStamp" & Format(Date, "mmm-dd-yyyy") & ".txt"
    >
    > DoCmd.OutputTo acOutputQuery, Qry_CPLYT_Regular, acFormatTXT, Path


    Rather than using the OutputTo method - which outputs a
    print-formatted file, with the lines and headers - use File... Export.
    Choose the .txt file option and use the Export Wizard to set up a
    comma delimited output file.

    John W. Vinson[MVP]
     
  4. Nikos Yannacopoulos

    Nikos Yannacopoulos
    Expand Collapse
    Guest

    Jay,

    Use TransferText instead of OutputTo. You may need to create an export
    specification in order to manipulate the output (e.g. drop the quotes as
    text qualifiers). To do so, do the export manually once, save the export
    spec that is created and note its name; you can then use it in your code.

    HTH,
    Nikos
     

Share This Page