2013년 5월 6일 월요일

read csv file in bash


#!/bin/bash

INPUT=$1 or file name
OLDIFS=$IFS
IFS=,

while read col1 col2 col3 col4 col5 col6
do
        echo $col4
done < $INPUT

IFS=$OLDIFS

$col6의 경우 마지막 열 까지 읽음

댓글 없음:

댓글 쓰기