Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.52 KB | None | 0 0
  1. BEGIN{
  2.  
  3.     # this is the full rgeex pattern i want to use
  4.     # if (match ($0, /^[a-zA-Z]+\tdouble|char\t[0-9]+|N\/A\t[a-zA-Z\s]+/))
  5.  
  6.         # using this variable DOES work
  7.         col1 = "[a-zA-Z]+";
  8.  
  9.         # using this variable DOESNT work
  10.         col2 = "double|char";
  11. }
  12. {
  13.         if (match ($0, /^(col1)\t(col2)\t[0-9]+|N\/A\t[a-zA-Z\s]+$/))
  14.         {  
  15.                 print $0;
  16.         }  
  17.         else
  18.         {  
  19.                 print "No match";
  20.         }  
  21. }
  22. END{
  23.         #Stuff for the end
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement