Mercurial > repos > devteam > condense_characters
annotate condense_characters.pl @ 0:5c87e8fdf38b draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
author | devteam |
---|---|
date | Mon, 09 Nov 2015 11:24:51 -0500 |
parents | |
children |
rev | line source |
---|---|
0
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
1 #! /usr/bin/perl -w |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
2 |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
3 use strict; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
4 use warnings; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
5 |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
6 # condenses all consecutive characters of one type |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
7 # convert_characters.pl [input] [character] [output] |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
8 |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
9 die "Check arguments" unless @ARGV == 3; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
10 |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
11 my $inputfile = $ARGV[0]; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
12 my $character = $ARGV[1]; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
13 my $outputfile = $ARGV[2]; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
14 |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
15 |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
16 my $convert_from; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
17 my $convert_to; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
18 |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
19 |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
20 if ($character eq "s") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
21 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
22 $convert_from = '\s'; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
23 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
24 elsif ($character eq "T") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
25 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
26 $convert_from = '\t'; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
27 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
28 elsif ($character eq "Sp") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
29 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
30 $convert_from = " "; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
31 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
32 elsif ($character eq "Dt") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
33 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
34 $convert_from = '\.'; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
35 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
36 elsif ($character eq "C") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
37 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
38 $convert_from = ","; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
39 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
40 elsif ($character eq "D") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
41 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
42 $convert_from = "-"; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
43 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
44 elsif ($character eq "U") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
45 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
46 $convert_from = "_"; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
47 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
48 elsif ($character eq "P") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
49 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
50 $convert_from = '\|'; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
51 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
52 else |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
53 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
54 die "Invalid value specified for convert from\n"; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
55 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
56 |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
57 |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
58 if ($character eq "T") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
59 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
60 $convert_to = "\t"; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
61 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
62 elsif ($character eq "Sp") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
63 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
64 $convert_to = " "; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
65 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
66 elsif ($character eq "Dt") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
67 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
68 $convert_to = "\."; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
69 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
70 elsif ($character eq "C") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
71 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
72 $convert_to = ","; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
73 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
74 elsif ($character eq "D") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
75 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
76 $convert_to = "-"; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
77 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
78 elsif ($character eq "U") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
79 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
80 $convert_to = "_"; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
81 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
82 elsif ($character eq "P") |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
83 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
84 $convert_to = "|"; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
85 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
86 else |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
87 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
88 die "Invalid value specified for Convert to\n"; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
89 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
90 |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
91 my $fhIn; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
92 open ($fhIn, "< $inputfile") or die "Cannot open source file"; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
93 |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
94 my $fhOut; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
95 open ($fhOut, "> $outputfile"); |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
96 |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
97 while (<$fhIn>) |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
98 { |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
99 my $thisLine = $_; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
100 chomp $thisLine; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
101 $thisLine =~ s/${convert_from}+/$convert_to/g; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
102 print $fhOut $thisLine,"\n"; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
103 } |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
104 close ($fhIn) or die "Cannot close source file"; |
5c87e8fdf38b
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/condense_characters commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
devteam
parents:
diff
changeset
|
105 close ($fhOut) or die "Cannot close output file"; |