View Single Post

  #2 (permalink)  
Old 07-22-2005, 02:49 PM
nixcraft's Avatar
nixcraft nixcraft is offline
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,060
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Following script logic will store line in $line and 3 fields in $f1, $f2, $f3
Code:
#!/bin/bash
filename="data.txt"
# line stores the one single line from $filename
while read line
  do
     f1="$(echo $line| cut -d, -f1)"
     f2="$(echo $line| cut -d, -f2)"
     f3="$(echo $line| cut -d, -f3)"
     # use f1 f2 f3 as parameter to  pass the values to some oracle procedure...
     # /path/to/oracle-client $f1 $f2 $f3
done < $filename
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote