read and cut

hi i am KSH shell script newbie:o i would like to ask how to create a shell script to read the CSV file then follow by cut the file line number 2 and echo it this 2nd line... i need some coding refference .....:confused:

firstly, i dont quite understand ur question..

csv file is separated by comma..you can read it like any other normal file

did u meaan cut the 2'nd line of the file and print- then

sed -n '/2/p' filename.csv

did u mean cut the 2'nd column of the file and print

while read line
do

filed2= `cut -d, -f2`
echo $filed2
done < filename.csv

cheers,
Devaraj Takhellambam

:osorry for my poor english:o

according to your script

while read line
do

filed2= `cut -d, -f2`
echo $filed2
done < filename.csv

e.g
/users/sally/myprogram1;My Program 1;
/users/sally/myprogram2;My Program 2;
this is the line which iis nside the filename.csv
so how to separate the /users/sally/myprogram1; as file1 and
My Program 1; as file2 by using cut command so the result will be echo $file1 and echo $file2
anyway thanks alot..:slight_smile: