another regular expression question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abaker83
    New Member
    • Nov 2007
    • 1

    another regular expression question

    Hey guys,
    I am new to regex, and don't know much about patterns.I am trying to match data on a specific line; believe it or not this is all on one line "P57_20711. txt 0000666 0000000 0000000 00012074176 0 Vcar H57002007102120 DOE CM1956904710 00. 200711012007113 0 00000.00 00000.00 00168 " I am trying to remove everything from the letter "P" to "Vcar" including spacing and begin the line at the "H". I hear that the best way to do it is using regular expressions Any ideas?
    Thanks
  • AHMEDYO
    New Member
    • Nov 2007
    • 112

    #2
    HI...

    i cant understand you question fully , you just wanna to remove data from P to vcar and just you will have these characters

    H57002007102120 DOE CM1956904710 00. 200711012007113 0 00000.00 00000.00 00168

    waiting your reply..


    GOOD LUCK

    Comment

    • 9815402440
      New Member
      • Oct 2007
      • 180

      #3
      hi
      please write the output you want from the code. this will help understanding the problam.

      regards
      manpreet singh dhillon hoshiarpur
      Last edited by Killer42; Nov 19 '07, 02:36 AM.

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Does the location of the desired data within the line vary? If not, you can just use Mid() or Right() function to grab it. If it does move, you can probably still do it almost as simply by using Instr() function to find your flag string ("Vcar") then either of the abovementioned functions to retrieve the rest of the line.

        I expect there may be a way to use regular expressions for this as well, but don't have any experience with them. (Seems like unnecessary complication, too.)

        Comment

        Working...