Yahweh gathering his people to bring them back from the foreign nations to the land of Israel is spoken of as if he were threshing wheat to separate the grain from the chaff. (See: [[rc://en/ta/man/jit/figs-metaphor]])
Isaiah mentions the Euphrates River and the Wadi of Egypt to mean that Yahweh will bring back the people of Israel who were exiled in lands near those waters, that is, Assyria and Egypt. The Euphrates River is northeast of Israel, and the Brook of Egypt is southwest of Israel.
This can be stated in active form. Alternate translation: "Yahweh will gather you together one by one" (See: [[rc://en/ta/man/jit/figs-activepassive]])