As I'm not into awk, here is something else...
Code:
#include <stdio.h>
#include <string.h>
static int is_junk(c)
int c;
{
if ((c >= '0')&&(c <='9')) return 0;
return 1;
}
int main()
{
char buf[4096];
while (fgets(buf,sizeof(buf),stdin))
{
int i=strlen(buf);
while (i--)
{
if ((buf[i]=='\n')||is_junk(buf[i]))
{
buf[i]=0;
}
else
{
break;
}
}
printf("%s\n",buf);
}
return 0;
}