Trying to number every other line and append those numbers to end of line
Hi all,
I have a file formatted like this: Code:
>Contig I am trying to give each Contig a number such that my output would be: Code:
>Contig1 Thanks! Kevin |
Code:
#!/usr/bin/perl |
try this..
Code:
#!/bin/sh |
I did it this way using awk.
Code:
awk -F "i=1" '{if (/>Contig/){print $0i++} else print}' file |
Same idea:
Code:
awk '/>/{print $0(++i)}!/>/' file |
Quote:
|
Quote:
|
Thanks!
|
All times are GMT -5. The time now is 08:21 AM. |