Hi Everyone,
So this I just had one problem solved very quickly by a nice guy on my other post.
http://stackoverflow.com/questions/3464207/erlang-splitting-lists-into-sub-list
Now I am a beginner at Erlang and need a little help with the syntax of another function that does work on the result from my previous post.
For example, I now have:
Reply = [<<56,45,34,07,45,67,34>>, <<12,23,56,07,67,67>>, <<55,23,45,07,89,56>>]
And I need to split it further to:
[ [<<56,45,34>>,<<45,67,34>>], [<<12,23,56>>,<<67,67>>] , [<<55,23,45>>, <<89,56>>] ]
The delimiter in this example is <<07>>
This code process's the binary
parse(Reply) -> binary:split(Reply, <<07>>, [global]).
But now how can I recursively go through the array and do it again.
Here is an example of my current code:
parse(Reply) -> binary:split(Reply, <<01>>, [global]).
parse2(Reply) -> binary:split(Reply, <<07>>, [global]).
func1(Done) -> [parse2(X) || X <- Done].
%%blah blah - get to the executing functions code
Done = parse(Reply),
Done1 = func1(Done),
I know it has to be something super simple the last one sure had me.
Best, -B