User Tools

Site Tools


read_comma_separated_file_csv_within_bash_script

Differences

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

Link to this comparison view

read_comma_separated_file_csv_within_bash_script [2012/10/25 08:51] (current)
root created
Line 1: Line 1:
 +====== Read comma separated file (CSV) within bash script ======
 +
 +  #!/bin/bash
 +  IFS=,
 +  while read field1 field2
 +  do
 + echo "​field1 : $field1"​
 + echo "​field2 : $field2"​
 +  done < filename.csv
 +
 +References
 +
 +[[http://​www.cyberciti.biz/​faq/​linux-unix-appleosx-bsd-shell-parse-text-file/​]]
 +
 +[[http://​www.cyberciti.biz/​faq/​unix-linux-bash-read-comma-separated-cvsfile/​]]
  
read_comma_separated_file_csv_within_bash_script.txt ยท Last modified: 2012/10/25 08:51 by root