Re: script not working, cl works
* L.V.Gandhi (2007-06-28):
> I have a csv file with 50 lines.
> lvgandhi@lvgvaio:~/stock/today$ tail -n 5 highs.csv
> BANKRAJAS,14
> GARWALLROP,14
> KERNEX,14
> ZENITHINFO,14
> ORBITCORP,14
> I have a script which has lines
> ===============================
> cd /home/lvgandhi/.qtstalker/data1/group/Highs
> rm -f *
> for stock in $(cat /home/lvgandhi/stock/today/highs.csv|cut -d,
> -f1);do ln -s /home/lvgandhi/.qtstalker/data1/data/Stocks/nse/$stock
> $stock;done
I don't know why it doesn't work for you, but you cat try this:
for i in $(cat /your/file | awk -F ',' '{print $1}') ; do echo ${i} ; done
or
export IFS=","
cat /your/file | while read a b ; do echo ${a} ; done
-André
--
May as well be hung for a sheep as a lamb!
Linux Kernel 2.6/PPC for Linkstation/KuroBox/HG/HS from http://hvkls.dyndns.org
Reply to: