This shows you the differences between two versions of the page.

Link to this comparison view

blog:readdelimfile [2009/11/27 17:53] (current)
Line 1: Line 1:
 +====== Read a Delimited File ======
 +How can you read a row in delimited file and get each field value into a separate variable?
 +<code bash>
 +while read f1 f2 f3; do
 +  echo "​$f1-$f2-$f3"​
 +done < delim.txt
 +Using the following input file as a sample:
 +Sample run:
 +$ ./delim.sh
 +{{tag>​shell programming}}