Welcome to SPN

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

Sign Up Now!
  1. Guest ji, please consider donating today!
      Become a Supporter    ::   Make a Contribution   
    Monthly Recurring Target: $300 :: Achieved: $95

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
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page