Array Searching

Started by seckner, February 21, 2018, 01:44:56 PM

Previous topic - Next topic

seckner

Attached is a very small sample file from a Robocopy log. I'm using ArrayFileGet to load the attached file into an array. Now I want to search the attay and count how many times  "(0x00000005)" is found throughout the array and that should be 2. How do I search for a portion of the line? The only what I've gotten anything back is to ArraySearch or ArrayLocate the entire string:

ArrayLocate(array, "2018/02/21 15:05:37 ERROR 5 (0x00000005) Copying File \\Server\Shares\Person\misc\Toot my horn.pdf") finds the line but obviously wont find the second because the time changes.

The original file is 9000+ lines long and there will be around 100 or more of them so I'm hoping for something other than line by line if it can be done. Is it possible?

JTaylor

Not sure the array approach is the best way.   Perhaps the Binary functions?

Jim

seckner

Never used them before, guess it's time to learn! Thank you Jim.

JTaylor

There is more than one way, as usual, but the BinaryTagInit() example would get you started and give you most everything you need.

Jim