Hi,
I have been trying to do a little script in Csh, to classify some information of a text document.
My problem appears when i have to calssificate two parts of the same line into different variables, for example in the document appears something like that:
ID NAME
999999,Michel Luka
888888,Lara Croft
In my scrypt, im trying to take first the ID to save it into a variable and second the NAME to save it in another variable, the only thing that i know is that with the code:
#!/bin/csh
foreach line ( "`cat login.dat`" )
echo $line
echo $line | cut -d "," -f 1
echo $line | cut -d "," -f 2
end
i get printed the two parts, but dont know how to save each part in different variables to do:
echo $ID and $NAME
Thanks, and sorry for my english, today im a bit thick