Find the answer to your Linux question:
Results 1 to 2 of 2
Hi all Its my first post in here so please be patient I am trying to use regex in perl script to detect allowed words from the file and then ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2010
    Posts
    1

    Smile [SOLVED] Regex help needed


    Hi all

    Its my first post in here so please be patient
    I am trying to use regex in perl script to detect allowed words from the file and then print output to the screen.

    As an example :

    I have text file with orders and returns :


    Item2-SKU-2-11.08.2010-online
    Item3-SKU-3-11.09.2010-return
    Item4-SKU-4-11.09.2010-store

    My question: is it possible to make sure that i am ony outputing to the screen orders based on few conditions like Item,order form e.g. online.And is it possible to have multiple matches (Item2 only diplay if ordered online etc)

    Your help is much appreciated

    Thanks

  2. #2
    Linux User
    Join Date
    Aug 2006
    Posts
    458
    Code:
    awk '/Item2/ && /online/' file
    this will print any line with "Item2" and "online" .

Posting Permissions

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