Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: script not working, cl works

From: André Berger <andre.berger(at)web.de>
Date: Thu Jun 28 2007 - 11:54:37 EDT

  • 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
Received on Thu Jun 28 12:16:51 2007

This archive was generated by hypermail 2.1.8 : Thu Jun 28 2007 - 12:20:08 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library