Machine for treating containers and corresponding lids each provided with a spout which extends from an upper surface, to contain a liquid for feeding animals, contained in containing baskets in an ordered manner according to a positioning pattern, comprising a first line for washing, treating and filling the containers with the lids removed, disposed in a first washing direction and which includes first transporter means (21, 22) to feed forward the containing baskets with the containers and a reclosing station, and a second line for washing and treating the lids removed from the containers disposed in a second washing direction disposed parallel to the first direction, wherein the second line comprises a frame that supports, disposed in sequence in the second direction, a positioning station for the lids received from a de-lidding station of the first line, a washing station for the lids, a pick-up station for the washed lids to be picked up and transported in correspondence to said reclosing station of the first line, wherein a mobile extractor member is provided, configured to remove the lids automatically from the containers at the de-lidding station, keeping them constrained and suspended in groups in coordination with said positioning pattern, and to transport them, in a third direction (Z') transverse to the first direction and to the second direction, toward the second parallel line for washing and treating the lids, at the positioning station, wherein a reclosing member is provided to reclose the containers with the lids, configured mobile to pick up the lids treated by the second line at the pick-up station to transport them positioned in groups in coordination with said positioning pattern toward the first line at the reclosing station, in a fourth direction (Z") transverse to the first direction and to the second direction, and to position them on the containers, reclosing them, wherein second transporter means are provided, configured to transport in an automated manner the lids positioned by the extractor member according to the positioning pattern in the second direction and comprising drawing means, able to be selectively driven in movement in said second direction and a plurality of positioning and support units of the lids constrained to said drawing means, configured to cooperate with the extractor member and disposed in a coordinated manner to said positioning pattern in order to position one independently from the other and to support said lids stably according to said positioning pattern, wherein said machine also comprises first and second transverse movement means (33, 133), upstream and downstream of the washing station of the second line, and configured to move respectively said extractor member and said reclosing member between a cantilevered position on the first line respectively at the de-lidding station and the reclosing station of the first line, and a cantilevered position on the second line respectively at the positioning station and the pick-up station of the second line, said first and second transverse movement means (33, 133) each comprising a cantilevered beam which extends transversely above the first line and the second line, respectively between the de-lidding station and the positioning station and between the reclosing station and the pick-up station, each cantilevered beam comprising a transmission member, driven by a respective motor and coupled to the extractor member and respectively to the reclosing member in order to move them, wherein each positioning and support unit comprises a pair of support bars of the lids disposed transversely to the second direction, connected by anchoring members to said drawing means, said support bars supporting at the upper part a plurality of centering and lateral holding means of the individual lids each of which has a central positioning seating for the lids and is shaped with an annular shape, with a lateral holding shell flared upward, so as to define an upper lead-in for positioning the lids, said centering and lateral holding means being disposed transversely distanced from each other along the support bars at a pitch coordinated with a pitch of said positioning pattern.