shell - Bash: Reading variables containing single or double words from a file -


I'm trying to read the content of a file using the whip v4.1.x in the input file May look like:

  1373232436 785907701 "ABC 245" 0 1 1373232436 1048824909 "DEFPCR" 1 1373232486 785907701 "UVUHN" 0 1 1373232486 1048824909 "110 9xyz" 1 0  

If I

  cat & lt; Filename & gt; | , Then read col1 col2 col3 col4 col5 col6 ... ... done  

I should get 3 basic values ​​

  "Abc 245" "def pqr" "uvw ghn" "110 9xyz"  

  while reading-R line; [[$ $ Line = ~ ^ (*. *) \ (. *) \ (\ ". * *" \). (* * * * *]] Col1 = $ {BASH_REMATCH [1]} col2 = $ {BASH_REMATCH [2]} col3 = $ {BASH_REMATCH [3]} col4 = $ {BASH_REMATCH [ 4]} col5 = $ {BASH_REMATCH [5]} did & lt; File.txt  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -