Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    String Manipulation (A2K)

    I have files that are named in the following fashion:

    ABC_123_456.txt

    I want to capture the entire name LESS the ".txt". How can I do this?

    I know it will require string manipulation but can't quite get it together.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: String Manipulation (A2K)

    If you have a string variable strFile that contains the file name, you can use
    <code>
    Left(strFile, InStr(strFile, ".") - 1)
    </code>
    This assumes that the period (point) before txt is the only one in the name.

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: String Manipulation (A2K)

    B E A U T I F U L !!!!!!!

    As always, thanks Hans.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •