I have not been able to solve that issue. So i was thinking maybe my logic to solve the overall problem is wrong, so i am looking for a bit of help on what would be a good way to approach the following task.
I have a list of 24 files that are produced daily. On some days all 24 files may not be produced. The filenames are in the format filename-2digitnumber ( e.g. log-01). In each of the files, i need to search for an occurrence of a particular word and see how many times it occurs. Once i have the occurrences per file, i then need to total up all the occurrences per file into a grand total.
The way i have gone about this was to do a for loop, which had an if statement within it which did a check to see if the file existed. Then I would do a count on the file and assign it to a variable, that is also a variable. I get stuck at this stage as in the above thread. Code example:
Any ideas on how to go about this will be appreciated.
Nothing in your post indicates that you are using the per file counts for anything but calculation. If only the grand total is of interest:
If there are unwanted files in the directory that match log-*, you'll need to refine the pattern (possibly using more than one).
Regards,
Alister
---------- Post updated at 08:52 AM ---------- Previous update was at 08:47 AM ----------
Quote:
Originally Posted by pravin27
That is never necessary and it will choke on filenames with IFS characters. The following is both safe and efficient:
Regards,
Alister
hello,
I'm a littlebit lost...
i have a table of single names and combination of two names and i want a table of ALL single names with ALL combinations (also the indirect ones).
- - - in reality the names are longer, not only a,b,.. and the table is tab-delimited, and the result table... (6 Replies)
Hello Friends,
I have a txt file like below
//*Init Start
Reg(read,12'h42E,16'h0000);
Nop(5628.5);
//*Init End
//*Main Start
Reg(read,12'h42E,16'h0000);
Nop(5628.5);
//*Main End
I want to calculate the values between //* Init Start & //* Init End
And //*Main Start & //*Main... (5 Replies)