Skip to main content
Tweeted twitter.com/StackUnix/status/901380717288050688
formatting
Source Link
Barmar
  • 10.6k
  • 1
  • 22
  • 29

I have a file like this with tab separated two columns:

ENSG00000242268.2 0.07563 ENSG00000270112.3 0.09976 ENSG00000167578.15 4.38608 ENSG00000273842.1 0.0 ENSG00000078237.5 4.08856

 ENSG00000242268.2 0.07563 ENSG00000270112.3 0.09976 ENSG00000167578.15 4.38608 ENSG00000273842.1 0.0 ENSG00000078237.5 4.08856 

I would like to remove the numeric extensions from the end in the 1st column, so the output will be:

ENSG00000242268 0.07563 ENSG00000270112 0.09976 ENSG00000167578 4.38608 ENSG00000273842 0.0 ENSG00000078237 4.08856

 ENSG00000242268 0.07563 ENSG00000270112 0.09976 ENSG00000167578 4.38608 ENSG00000273842 0.0 ENSG00000078237 4.08856 

Simply doing sed 's/\..*$//' returns only first column value and using awk with field separator '.' , awk -F'.' removes the values from second column too as there are decimal numbers.

A similar question has been answered here: removing extensions in a column

I am still not being able to delete just from column 1st only.

I have a file like this with tab separated two columns:

ENSG00000242268.2 0.07563 ENSG00000270112.3 0.09976 ENSG00000167578.15 4.38608 ENSG00000273842.1 0.0 ENSG00000078237.5 4.08856

I would like to remove the numeric extensions from the end in the 1st column, so the output will be:

ENSG00000242268 0.07563 ENSG00000270112 0.09976 ENSG00000167578 4.38608 ENSG00000273842 0.0 ENSG00000078237 4.08856

Simply doing sed 's/\..*$//' returns only first column value and using awk with field separator '.' , awk -F'.' removes the values from second column too as there are decimal numbers.

A similar question has been answered here: removing extensions in a column

I am still not being able to delete just from column 1st only.

I have a file like this with tab separated two columns:

 ENSG00000242268.2 0.07563 ENSG00000270112.3 0.09976 ENSG00000167578.15 4.38608 ENSG00000273842.1 0.0 ENSG00000078237.5 4.08856 

I would like to remove the numeric extensions from the end in the 1st column, so the output will be:

 ENSG00000242268 0.07563 ENSG00000270112 0.09976 ENSG00000167578 4.38608 ENSG00000273842 0.0 ENSG00000078237 4.08856 

Simply doing sed 's/\..*$//' returns only first column value and using awk with field separator '.' , awk -F'.' removes the values from second column too as there are decimal numbers.

A similar question has been answered here: removing extensions in a column

I am still not being able to delete just from column 1st only.

added 8 characters in body; edited title
Source Link
GAD3R
  • 69.9k
  • 32
  • 147
  • 216

deleting Deleting extension from only from the first column

I have a file like this with tab separated two columns:

ENSG00000242268.2 0.07563 ENSG00000270112.3 0.09976 ENSG00000167578.15 4.38608 ENSG00000273842.1 0.0 ENSG00000078237.5 4.08856

I would like to remove the numeric extensions from the end in the 1st column, so the output will be:

ENSG00000242268 0.07563 ENSG00000270112 0.09976 ENSG00000167578 4.38608 ENSG00000273842 0.0 ENSG00000078237 4.08856

Simply doing sed 's/..*$//'sed 's/\..*$//' returns only first column value and using awk with field separator '.' awk -F'.''.' , awk -F'.' removes the values from second column too as there are decimal numbers.

A similar question has been answered here: removing extensions in a column

I am still not being able to delete just from column 1st only.

deleting extension from only first column

I have a file like this with tab separated two columns:

ENSG00000242268.2 0.07563 ENSG00000270112.3 0.09976 ENSG00000167578.15 4.38608 ENSG00000273842.1 0.0 ENSG00000078237.5 4.08856

I would like to remove the numeric extensions from the end in the 1st column, so the output will be:

ENSG00000242268 0.07563 ENSG00000270112 0.09976 ENSG00000167578 4.38608 ENSG00000273842 0.0 ENSG00000078237 4.08856

Simply doing sed 's/..*$//' returns only first column value and using awk with field separator '.' awk -F'.' removes the values from second column too as there are decimal numbers.

A similar question has been answered here: removing extensions in a column

I am still not being able to delete just from column 1st only.

Deleting extension only from the first column

I have a file like this with tab separated two columns:

ENSG00000242268.2 0.07563 ENSG00000270112.3 0.09976 ENSG00000167578.15 4.38608 ENSG00000273842.1 0.0 ENSG00000078237.5 4.08856

I would like to remove the numeric extensions from the end in the 1st column, so the output will be:

ENSG00000242268 0.07563 ENSG00000270112 0.09976 ENSG00000167578 4.38608 ENSG00000273842 0.0 ENSG00000078237 4.08856

Simply doing sed 's/\..*$//' returns only first column value and using awk with field separator '.' , awk -F'.' removes the values from second column too as there are decimal numbers.

A similar question has been answered here: removing extensions in a column

I am still not being able to delete just from column 1st only.

added 31 characters in body
Source Link
Roli
  • 213
  • 1
  • 4
  • 12

I have a file like this with tab separated two columns:

ENSG00000242268.2 0.07563 ENSG00000270112.3 0.09976 ENSG00000167578.15 4.38608 ENSG00000273842.1 0.0 ENSG00000078237.5 4.08856

I would like to remove the numeric extensions from the end in the 1st column, so the output will be:

ENSG00000242268 0.07563 ENSG00000270112 0.09976 ENSG00000167578 4.38608 ENSG00000273842 0.0 ENSG00000078237 4.08856

Simply doing sed 's/..*$//' returns only first column value and using awk with field separator '.' awk -F'.' removes the values from second column too as there are decimal numbers.

A similar question has been answered here: removing extensions in a column

I am still not being able to delete just from column 1st only.

I have a file like this:

ENSG00000242268.2 0.07563 ENSG00000270112.3 0.09976 ENSG00000167578.15 4.38608 ENSG00000273842.1 0.0 ENSG00000078237.5 4.08856

I would like to remove the numeric extensions from the end in the 1st column, so the output will be:

ENSG00000242268 0.07563 ENSG00000270112 0.09976 ENSG00000167578 4.38608 ENSG00000273842 0.0 ENSG00000078237 4.08856

Simply doing sed 's/..*$//' returns only first column value and using awk with field separator '.' awk -F'.' removes the values from second column too as there are decimal numbers.

A similar question has been answered here: removing extensions in a column

I am still not being able to delete just from column 1st only.

I have a file like this with tab separated two columns:

ENSG00000242268.2 0.07563 ENSG00000270112.3 0.09976 ENSG00000167578.15 4.38608 ENSG00000273842.1 0.0 ENSG00000078237.5 4.08856

I would like to remove the numeric extensions from the end in the 1st column, so the output will be:

ENSG00000242268 0.07563 ENSG00000270112 0.09976 ENSG00000167578 4.38608 ENSG00000273842 0.0 ENSG00000078237 4.08856

Simply doing sed 's/..*$//' returns only first column value and using awk with field separator '.' awk -F'.' removes the values from second column too as there are decimal numbers.

A similar question has been answered here: removing extensions in a column

I am still not being able to delete just from column 1st only.

Source Link
Roli
  • 213
  • 1
  • 4
  • 12
Loading