Hi Monks,
I have some doubts related to file operations and hash of arrays which are as follows:
1. I would like to know that how will I do the translation/ substitution operation on the data stored in Hash of Array data structures.
2. If I have a file 4 columns where the first column act as the id (which can be repeated) and the other three columns are the integer values.
DATA: id col1 col2 col3 12 100 12 196 12 120 15 190 13 90 190 200 13 70 20 20 13 101 340 25 14 100 123 19 15 80 389 39
I have read the entire data in a file into Hash of Array. I would like to know how can I do the sum of the rows without taking the the values of the same id present in other columns of the file. My output should look like :
Output: id Sum 12 308 12 325 13 480 13 110 13 466 14 242 15 508
3. Is their any faster option to delete any column of the file without reading it line by line and then deleting the column using splice function or shift (for deleting the first column) etc.
In reply to Hash of Arrays and File Operations by snape
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |