An example of an input in .txt file is below, the number of lines varies from file to file and I have 2 or 3 columns with values. I would like to read all the values (probably one by one) and set them to independent unique variables that can be used later for mathematical operations or "cat" outputs. Is it possible to do it in C-shell? I would not like to change the shell because I want to add this part to my "value extraction" script which I made.
Thanks for the message. I am sorry I thought it was clear enough. Actually I am not expecting any output just assiging the values to variables (if that is what you meant):
if you describe the 'specific format' AND what the 'further calculations' are maybe you don't need 'variables' (most likely not) and everything (including the calculations) can be done in one step.
OK I did not want to go to much into details... So I want to use whose variables to write to the new text file e.g. out_PyMOL_angles_{$pdbid}.txt (which will be actually a PyMOL script to calculate structural properties in the protein e.g. angle between two helices) such as:
cat > out_PyMOL_angles_{$pdbid}.txt << EOF -- $pdbid has been defined already
# Output for generating helix assignement in $pdbid.txt
async=0
select HELIX1, /$pdbid//$ChainId/$variable n1 - $variable n2/ -- where $variable n1 is 125 and $variable n2 is 143 (first line column 1 and column 2)
select HELIX2, /$pdbid//$ChainId/$variable n4 - $variable n5/ -- where $variable n4 is 149 and $variable n5 is 153 (second line column 1 and column 2)
angle_between_helices HELIX1, HELIX2
EOF
But with the above part I am fine.
I just need to set/assign all the values from the original .txt file into unique variables: