Hi
I have strings like these :
Vengeance mitt
Men Vengeance gloves
Women Quatro Windstopper Etip gloves
Quatro Windstopper Etip gloves
Girls Thermobite hooded jacket
Thermobite Triclimate snow jacket
Boys Thermobite Triclimate snow jacket
and I would like to get the lower case words at the end of each line and put them at the begining and put Men, women, girls, boys, if present, at the end. My attempd doesn't work :
{
$0=gensub(/^(Men |Women |Boys |Girls |)(([A-Z][a-z\-]+ )+)(([a-z\-]+ )+)/,"\\3\\2\\1","g");
print $0;
}
Can you help figure it out with gawk and gensub ?
Thanks