回答編集履歴

2

correction

2018/06/19 13:51

投稿

KojiDoi
KojiDoi

スコア13671

test CHANGED
@@ -50,6 +50,6 @@
50
50
 
51
51
  ```
52
52
 
53
- perl -pe 's/(gene_name ")([^"]+)/sprintf("$1$2-%d",$c{$2})/eg;' fantom_cat_stringent_kd.gtf > out.gtf
53
+ perl -pe 's/(gene_name ")([^"]+)/sprintf("$1$2-%d",$c{$2})/eg; $c{$2}++;' fantom_cat_stringent_kd.gtf > out.gtf
54
54
 
55
55
  ```

1

+perl

2018/06/19 13:51

投稿

KojiDoi
KojiDoi

スコア13671

test CHANGED
@@ -43,3 +43,13 @@
43
43
 
44
44
 
45
45
  ```
46
+
47
+
48
+
49
+ ちなみにperlならワンライナーで対処できそうです。
50
+
51
+ ```
52
+
53
+ perl -pe 's/(gene_name ")([^"]+)/sprintf("$1$2-%d",$c{$2})/eg;' fantom_cat_stringent_kd.gtf > out.gtf
54
+
55
+ ```