-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchangeChainId.txt
More file actions
executable file
·54 lines (42 loc) · 1.49 KB
/
changeChainId.txt
File metadata and controls
executable file
·54 lines (42 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/perl -w
# Author: Abdullah Kahraman
# Date: 11.07.2009
use strict;
use warnings;
use Getopt::Long;
###########################################################
##############################################################################
### read all needed parameters from commandline ##############################
##############################################################################
my(
$cin,
$cout,
);
&GetOptions(
"i=s" => \$cin, # chain to be changed
"o=s" => \$cout, # into chain
) or die "\nTry \"$0 -h\" for a complete list of options\n\n";
##############################################################################
##############################################################################
### SUBROUTINES
##############################################################################
##############################################################################
##############################################################################
##############################################################################
### MAIN
##############################################################################
##############################################################################
if(!defined $cin or !defined $cout){
die "Please specify \"-i and -o\"\n";
}
$cin = " " if($cin eq "_");
$cout = " " if($cout eq "_");
while(<>){
if(/^ATOM/){
my $chainId = substr($_, 21, 1);
if($chainId eq $cin){
substr($_,21,1,uc($cout));
}
}
print $_;
}