
Giffredo
Novice
Mar 25, 2014, 4:56 AM
Post #13 of 16
(36981 views)
|
Re: [Chris Charley] Split table,Count and substitution character
[In reply to]
|
Can't Post
|
|
Ok your code works well (in fact unix said me that I have not Text::CSV module. Can you explain me the code and in particular this line: open my $out, ">", 'new.txt' or die $!; I d like to be able to change the code in base on new necessities.. For example on this input: chrM 982 A 14 .....+2TG.......,, 69=9;<><5<==79 chrM 983 G 14 ............,, 69<95;>=3=:879 chrM 984 T 14 ............,, 84<9=<>=3=<:.: chrM 985 A 14 ............,, 84=7=:<=6=<857 chrM 986 G 15 ............,,, 74<7;<<>5=<<.1: chrM 987 A 15 ............,,, 7:<6<=<=9@<<204 chrM 988 A 14 ............,, 4285586528787: chrM 989 G 14 ............,, 97<;8><;9=<<76 chrM 990 A 15 .....-1C....-1C...,,, 76<=5=;<9=<<4.7 chrM 991 C 14 ....*..*...,,, 36=;0=96=:<4=. chrM 992 T 13 ...........,, 36=<0=96=;;07 chrM 993 T 12 .........,,, 09/74/6506>. chrM 994 A 13 ..........,,, 36>5<958;87;. chrM 995 T 14 ...........,,, 3<;5<7;57=37<. chrM 996 A 13 ..........,,, 9;<<8<98:56<. chrM 997 G 13 ..........,,, 9:5;7<5:838<7 chrM 998 A 13 ..........,,, 9:5<==5:8=845 chrM 999 T 13 ..........,,, ;;5;=?4:7<631 chrM 1000 T 12 .........,,, 60/4585.786; chrM 1001 A 13 ..........,,, ;74::=297<212 chrM 1002 A 13 ..........,,, ?74:;<2=7;?<< chrM 1003 A 13 ..........,,, ?74::<2=7;?<< chrM 1004 A 10 .......,,, 2.301/5@;< chrM 1005 T 13 ..........,,, 644:7;1:6;766 chrM 1006 T 12 .........,,, 2567/37389;; chrM 1007 C 13 ....$.$.$....,,, 6<;=5:3:8B9;; chrM 1008 T 10 .......,,, 8=;9<7>;78 chrM 1009 C 10 .......,,, 8>;7>9B4/0 chrM 1010 C 9 ...$.$.$.$,,, 861159:56 chrM 1011 A 8 ...,,,^S.^S. .=;5/0?= How I can count the "." and "," leaving the symbols in the middle? for example on the first row I want to keep the +2TG.. transform the row in something like: chrM 982 A 14 12:2 +2TG
|