title: UPDATED Using grep/sed/awk as if expression to sort strings and put them to different txt files
body: <p>Got some problem. Heres my log file. </p>
  
  <pre><code>otf.msn.com
  otf.msn.com
  accounts.google.com
  Email=adresemail@gmail.com
  www.x-kom.pl
  login=exampleelog
  allegro.pl
  ssl.allegro.pl
  www.bing.com
  www.bing.com
  www.bing.com
  www.bing.com
  store.steampowered.com
  username=steamaccountereed
  login.live.com
  login=mailhotmail@hotmail.com
  www.bing.com
  </code></pre>
  
  <p>I want to segregate emails, login, and sites.
  to filter emails and logins from everything i'm using</p>
  
  <pre><code>grep -oP '\(\K[^)]*|(user=|username=|Email=|login=)[^&amp;]*' file.txt
  </code></pre>
  
  <p>to get emails from the rest </p>
  
  <pre><code>grep -P '^(?=.*@.*)' file.txt
  </code></pre>
  
  <p>I was thinking about the solution to make 3 tables - emails, users 
  There's my scheme </p>
  
  <pre><code>if "its username or mail" 
    if [email condtion]
     then write emails to emails tab
  else 
  write to users tab
  else
   write it to 'site' table
  </code></pre>
  
  <p>What i want in output is 2 files - one with email adresses, one with users connected with sites like </p>
  
  <pre><code> steampowered.com - username=steamaccountereed
      x-kom.pl - login=exampleelog
  </code></pre>
  
  <p>UPDATE : This fields (like email, username) will be used in script. 
  THere will be question for user ?</p>
  
  <pre><code>Choose mail to send a massage:
  mailhotmail@hotmail.com
  adresmail@gmail.com
  </code></pre>
  
  <p>Mail adresses should be loaded from other file / table etc.</p>
  
  <p>Next question for user :</p>
  
  <pre><code>Choose site :
  steampowered.com - username=steamaccountereed
  x-kom.pl - login=exampleelog
  </code></pre>
  
  <p>Moreover i need relations between users and sites : if i choose a site, i would know username from this site. The site is always 1 line above the user/login field.</p>
  
  <p>I'm new in bash and need help with that ;(</p>