#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    1
    Rep Power
    0

    Get Word after First Occurrence of Word


    I have a file containing strings of SQL, e.g.,

    12345 SELECT FIELD1 FROM TABLE1
    12346 THIS IS A STATEMENT THAT DOESN'T NEED TO BE SEEN
    12347 SELECT FIELD2 FROM TABLE2 WHERE

    I would like to output something like:
    TABLE1
    TABLE2
    the first word after FROM. Words are delimited by spaces in this file.

    Thank you.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2012
    Location
    Paris area, France
    Posts
    843
    Rep Power
    496
    Something like this:

    Code:
    /FROM\s+(\w+)/

IMN logo majestic logo threadwatch logo seochat tools logo