-1

I'm trying to extract information from two genetic files based on chromosome position which are in the format 01:23456 and 1:23456. Can you please help me with a code to either remove zeros from the first file (only from 01 to 09, because the rest of the numbers are from 10:34498 to 22:383408) or add zeros to the other file in linux?

Thank you!

I want either 01:23456 to 1:23456 or 1:23456 to 01:23456. It's an entire row or chromosome:position from 01:23456 to 22:383408. I want the changes to be made only for 01:23456 to 09:495988. That is only from 1 to 9.

Joe
  • 8,073
  • 1
  • 52
  • 58
Doodle
  • 11
  • 6

1 Answers1

0

I found it !

This works:

awk '{sub(/^0*/,"");}1' file.csv 

Regards.

Joe
  • 8,073
  • 1
  • 52
  • 58
Doodle
  • 11
  • 6