On the minecraft wiki i found a statement that may be of use to you.
I dont know if its still of any use or if it has been changed but its worth a try.
Dig holes.
Dig a hole outside of the farm, at least 3 blocks deep (two for the tunnel, one for the ceiling).
Place ladders as needed.
Tunnel under the fence, and dig up under the farm.
Place more ladders.
Since Pigs, Cows, and Sheep are more than one block wide, they will not fit in the hole resulting in them running in circles trying to get in the hole.
However, baby animals and Chickens can fit in a one block hole, so you may want to place a trapdoor at the top.
In version 12w34a and later, the trapdoor can be placed in the top block of the hole; in older versions, making it level with the farm requires putting an extra block inside the farm to attach it to (don't put it within two blocks of the fence).
Of course, the tunnel can also lead to somewhere more distant....
Source
Your farming floor would look something like this.
X X
X
X
X
X
X
X
X X XX B
H B H B H B H B XX H B H B H B H
B H
XX B
H B H B H B H
B
X X H B
H B H B H
B H
XX B
H B H B H B H B XX H B H B H B H B H XX
X X X X X X X X X XX
= fancy fencing of some sort.
B = Block or the floor of your pen.
H = Hole in the floor (at least 3 deep) Then under that layer you would place a water slide to another pen where the young animals can age for slaughter (or more amusing ways of entertainment) .
I will try this when i get home and ill maybe even post some screenshots or upload a video for you.
EDIT here are the screenshot i promised. to describe the above images.
The holes in the floor allow for the baby cows (calves) to fall in the water and to flow to the gathering area.
The mature cows stay on top and are there to be fed.
gaming.stackexchange.com/users/44442/Marco Geertsma
You could use the MineFactory Reloaded mod to do this.
A Breeder sends carrots, wheat, seeds, etc.
to animals in a pen.
A Chronotyper would separate the baby animals from the adults, and a second Chronotyper would separate them again after they've grown.
A Grinder could be used to kill them, with drops transported using conveyor belts and hoppers from vanilla Minecraft.
The Mob Essence from the Grinder can be used in a Spawner to spawn more adult animals from a safari net, which can be killed.
The Feeding Station from RailCraft could also get you a lot of cows with a stack of wheat.
A tier 5 soul shard from the Soul Shards mod spawns adult animals whenever ther is no redstone pulse, so you could use that to your advantage.
gaming.stackexchange.com/users/None/
No redstone, no minecarts...
Through 5 minutes of item testing I found that adult animals can fall through a 1x1 hole.
There is one item (maybe more, haven't tested them all)
that works.
Here's how you do it: on the floor of your breeding area, replace some of the floor with open trapdoors, with a room under it.
View from the top:
d = dirt t
= trapdoordddddddddddttttttttddtddddddtddtdtttttdtddtdtdddtdtddtdtdtdtdtd
dtdtdddtdtddtdtttttdtddtdddddddtddtttttttttdddddddddddd P.S. closing the trapdoors allows you to expand your population of adult animals without have to force fully grown animals into the pen.
EDIT:I took some pictures.
Once I figure out how to make youtube videos i might make an actual tutorial for this and many other of my creations.
Another Edit:I spent another 2 hours thinking how to make the kill machine better.
I rewired it
so you hit a button to get the cooked meat.
After I wire it to have a button for raw meat instead of a switch I might post a new picture.
gaming.stackexchange.com/users/54340/jonny909190
In terms of chickens I discovered that you can allow chicks to pass and hold back adult chickens by using half blocks such as slabs, placed so there are half block gaps out of an enclosure
gaming.stackexchange.com/users/143434/Geoff Davids
An alternative approach, is to change how you do breeding.
For instance, if you have the two adults in mine carts, their offspring drops off away from the mine carts keeping the separation.
Another way, since babies take 10 minutes (IIRC) to mature, after breeding, start a 10 minute timer, and have your automatic butcher system only butcher some of the animals.
gaming.stackexchange.com/users/16398/John
Is there any way to automatically pick out adult animals (most preferably cows, but if you have info on other species, please share too) from the baby ones?  Specifically, keep the baby animals away while picking out adult ones for automated butchering.
How to separate adult from baby animals?
gaming.stackexchange.com
<minecraft-java-edition>
gaming.stackexchange.com/questions/122053
gaming.stackexchange.com/users/9440/SF.
You can try the MineFactory Reloaded mod or using half blocks to hold back the adults. To effectively separate animals in Minecraft you have either to use mods or some tracking tactics, with in game and out of game items.
Using a mod is proposed. Some people suggesting ways to tackle this matter.