delete a string on column1

Hi

I have a file with multiple columns. But there is something weird on column one that is attached to the name. The good thing is that its a consistent pattern so there should be a way to remove it.

So the first column looks something like this:

name_345.4ml
date_3456.4ml
year_12.4ml
last_2.4ml

and I want it to look like this

name
date
year
last

I was using this awk line (below) to replace the _ and . with a tab then going in and deleting the 2 new columns but that was tedious.

awk -F"_" -v OFS="/t" ' $1=$1 '

does anyone know a quick way to do this?

thanks

Hi.

Not sure I follow you. How many "columns" are there?

To get the output you asked for,

awk -F_ '{print $1}' 

would do.

or even

cut -d_ -f1

But are there more columns? If so, why don't you show them?

yes there are many more columns but I do not need to modify those columns

the number of columns actually varies per row...

thanks

Whether you need to modify them of not, it helps if you give an overall picture, otherwise any solution given might not be fitting.

awk '{sub(/_.*/, "", $1)} 1'