Hello, I have a file like that
FUNCT_CURVE curve_id_num 5
abs coord
1 4
2 5
6 7
7 9
8 10
END
Small explanation: I have a text file I want to read from it and store the values of the abscissa and coordinate in a hash or array... note next to the line FUNCT_CURVE the number stands for how many lines of abs and coord we have.
of course in the file i have there is several functions with different curve id.
thanks for the help in advance and any info needed, please let me know.
PS: I used substrings and pattern matching, but what is hard for me is going in the loop and storing these values
foreach $data (@inp_data)
{
if($data=~ m/^FUNCT /)
{
$function_id= substr("$data", x, y);
$all_functions{$function_id}=$function_id; # used for sorting them as hash....
FUNCT_CURVE curve_id_num 5
abs coord
1 4
2 5
6 7
7 9
8 10
END
Small explanation: I have a text file I want to read from it and store the values of the abscissa and coordinate in a hash or array... note next to the line FUNCT_CURVE the number stands for how many lines of abs and coord we have.
of course in the file i have there is several functions with different curve id.
thanks for the help in advance and any info needed, please let me know.
PS: I used substrings and pattern matching, but what is hard for me is going in the loop and storing these values
foreach $data (@inp_data)
{
if($data=~ m/^FUNCT /)
{
$function_id= substr("$data", x, y);
$all_functions{$function_id}=$function_id; # used for sorting them as hash....