Rev 728 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 728 | Rev 892 | ||
|---|---|---|---|
| 1 | #!/usr/bin/perl -w |
1 | #!/usr/bin/perl -w |
| 2 | 2 | ||
| 3 | $debugmode = 0; |
3 | $debugmode = 0; |
| 4 | 4 | ||
| 5 |
|
5 | #$outputpath = "outp/"; |
| 6 |
|
6 | #$linenrpath = "linenr.txt"; |
| 7 |
|
7 | #$contentspath = "contents.txt"; |
| 8 |
|
8 | #$currentfilepath = "currentfile.txt"; |
| 9 |
|
9 | #$logfilepath = "#hobby_small.log"; |
| 10 |
|
10 | #$contentsfileoutput = "outp/"; |
| 11 |
|
11 | #$contentsfilename = "hobby.txt"; |
| 12 | $contentsheader = "====== Log of #hobby-channel ======\n"; |
12 | $contentsheader = "====== Log of #hobby-channel ======\n"; |
| 13 |
|
13 | #$namespace = "common:irc:hobby:"; |
| 14 | 14 | ||
| 15 |
|
15 | #require "settings.pl"; |
| - | 16 | use File::Copy; |
|
| 16 | 17 | ||
| 17 | $numArgs = $#ARGV + 1; |
18 | $numArgs = $#ARGV + 1; |
| 18 | if ($numArgs == 1) { |
19 | if ($numArgs == 1) { |
| 19 | if ($ARGV[0] eq "-r") { |
20 | if ($ARGV[0] eq "-r") { |
| 20 | #reset log system |
21 | #reset log system |
| 21 | 22 | ||
| 22 | $fileopenerr = 0; |
23 | $fileopenerr = 0; |
| 23 | open (LINENR, ">".$linenrpath) or $fileopenerr = 1; |
24 | open (LINENR, ">".$linenrpath) or $fileopenerr = 1; |
| 24 | if ($fileopenerr == 0) { |
25 | if ($fileopenerr == 0) { |
| 25 | print LINENR "0"; |
26 | print LINENR "0"; |
| 26 | close(LINENR); |
27 | close(LINENR); |
| 27 | } |
28 | } |
| 28 | 29 | ||
| 29 | $fileopenerr = 0; |
30 | $fileopenerr = 0; |
| 30 | open (CONTENTSFILE, ">".$contentspath) or $fileopenerr = 1; |
31 | open (CONTENTSFILE, ">".$contentspath) or $fileopenerr = 1; |
| 31 | if ($fileopenerr == 0) { |
32 | if ($fileopenerr == 0) { |
| 32 | print CONTENTSFILE ""; |
33 | print CONTENTSFILE ""; |
| 33 | close(CONTENTSFILE); |
34 | close(CONTENTSFILE); |
| 34 | } |
35 | } |
| 35 | close(CONTENTSFILE); |
36 | close(CONTENTSFILE); |
| 36 | 37 | ||
| 37 | $fileopenerr = 0; |
38 | $fileopenerr = 0; |
| 38 | open (CURRFILE, ">".$currentfilepath) or $fileopenerr = 1; |
39 | open (CURRFILE, ">".$currentfilepath) or $fileopenerr = 1; |
| 39 | if ($fileopenerr == 0) { |
40 | if ($fileopenerr == 0) { |
| 40 | print CURRFILE ""; |
41 | print CURRFILE ""; |
| 41 | close(CURRFILE); |
42 | close(CURRFILE); |
| 42 | } |
43 | } |
| 43 | #print "exit\n"; |
44 | #print "exit\n"; |
| 44 | exit; |
45 | exit; |
| - | 46 | } |
|
| - | 47 | } |
|
| - | 48 | ||
| - | 49 | if ($numArgs == 2) { |
|
| - | 50 | if ($ARGV[0] eq "-s") { |
|
| - | 51 | require "$ARGV[1]"; |
|
| 45 | } |
52 | } |
| 46 | } |
53 | } |
| 47 | 54 | ||
| 48 | $startAtLine = 0; |
55 | $startAtLine = 0; |
| 49 | $currentfile = ""; |
56 | $currentfile = ""; |
| 50 | 57 | ||
| 51 | $fileopenerr = 0; |
58 | $fileopenerr = 0; |
| 52 | open (LINENR, "<".$linenrpath) or $fileopenerr = 1; |
59 | open (LINENR, "<".$linenrpath) or $fileopenerr = 1; |
| 53 | if ($fileopenerr == 0) { |
60 | if ($fileopenerr == 0) { |
| 54 | $startAtLine = <LINENR>; |
61 | $startAtLine = <LINENR>; |
| 55 | if ($startAtLine =~ /\D/) { |
62 | if ($startAtLine =~ /\D/) { |
| 56 | print "Not a number\n"; |
63 | print "Not a number: $startAtLine\n"; |
| 57 | exit; |
64 | exit; |
| 58 | } |
65 | } |
| 59 | close(LINENR); |
66 | close(LINENR); |
| 60 | } else { |
67 | } else { |
| 61 | print "Could not open ".$linenrpath; |
68 | print "Could not open ".$linenrpath; |
| 62 | exit; |
69 | exit; |
| 63 | } |
70 | } |
| 64 | 71 | ||
| 65 | $fileopenerr = 0; |
72 | $fileopenerr = 0; |
| 66 | open (CURRFILE, "<".$currentfilepath) or $fileopenerr = 1; |
73 | open (CURRFILE, "<".$currentfilepath) or $fileopenerr = 1; |
| 67 | if ($fileopenerr == 0) { |
74 | if ($fileopenerr == 0) { |
| 68 | $currentfile = <CURRFILE>; |
75 | $currentfile = <CURRFILE>; |
| 69 | if (!$currentfile && $startAtLine != 0) { |
76 | if (!$currentfile && $startAtLine != 0) { |
| 70 | print "Current file not ok\n"; |
77 | print "Current file not ok\n"; |
| 71 | exit; |
78 | exit; |
| 72 | } |
79 | } |
| 73 | close(CURRFILE); |
80 | close(CURRFILE); |
| 74 | } else { |
81 | } else { |
| 75 | print "Could not opeen ".$currentfilepath; |
82 | print "Could not opeen ".$currentfilepath; |
| 76 | if ($startAtLine != 0) { |
83 | if ($startAtLine != 0) { |
| 77 | exit; |
84 | exit; |
| 78 | } |
85 | } |
| 79 | } |
86 | } |
| 80 | 87 | ||
| 81 | $fileopenerr = 0; |
88 | $fileopenerr = 0; |
| 82 | open (LOGFILE, "<".$logfilepath) or $fileopenerr = 1; |
89 | open (LOGFILE, "<".$logfilepath) or $fileopenerr = 1; |
| 83 | if ($fileopenerr == 1) { |
90 | if ($fileopenerr == 1) { |
| 84 | print "Could not open ".$logfilepath; |
91 | print "Could not open ".$logfilepath; |
| 85 | exit; |
92 | exit; |
| 86 | } |
93 | } |
| 87 | 94 | ||
| 88 | if ($currentfile) { |
95 | if ($currentfile) { |
| 89 | if ($debugmode == 0) { |
96 | if ($debugmode == 0) { |
| 90 | $fileopenerr = 0; |
97 | $fileopenerr = 0; |
| 91 | open (OUTFILE, ">>".$outputpath.$currentfile) or $fileopenerr = 1; |
98 | open (OUTFILE, ">>".$outputpath.$currentfile) or $fileopenerr = 1; |
| 92 | if ($fileopenerr == 1) { |
99 | if ($fileopenerr == 1) { |
| 93 | print "Could not open ".$outputpath."/".$currentfile; |
100 | print "Could not open ".$outputpath."/".$currentfile; |
| 94 | exit; |
101 | exit; |
| 95 | } |
102 | } |
| 96 | } |
103 | } |
| 97 | } |
104 | } |
| 98 | 105 | ||
| 99 | @colors = ("#2F4F4F","#696969","#A0522D","#D2691E","#DAA520","#191970","#0000CD","#4682B4","#7FEFD4","#556B2F","#008B8B","#808000","#2E8B57","#32CD32","#483D8B","#6A5ACD","#8A2BE2","#BDB76B","#EF4500","#C71585","#8B0000","#DC143C","#E9967A","#CD5C5C","#B0E0E6","#E0E0C0"); |
106 | @colors = ("#2F4F4F","#696969","#A0522D","#D2691E","#DAA520","#191970","#0000CD","#4682B4","#7FEFD4","#556B2F","#008B8B","#808000","#2E8B57","#32CD32","#483D8B","#6A5ACD","#8A2BE2","#BDB76B","#EF4500","#C71585","#8B0000","#DC143C","#E9967A","#CD5C5C","#B0E0E6","#E0E0C0"); |
| 100 | $nrofcolors = @colors; |
107 | $nrofcolors = @colors; |
| 101 | 108 | ||
| 102 | $linecnt = 0; |
109 | $linecnt = 0; |
| 103 | while (<LOGFILE>) { |
110 | while (<LOGFILE>) { |
| 104 | #print $linecnt ." "; |
111 | #print $linecnt ." "; |
| 105 | $line = $_; |
112 | $line = $_; |
| 106 | #$store = ""; |
113 | #$store = ""; |
| 107 | if ($linecnt >= $startAtLine) { |
114 | if ($linecnt >= $startAtLine) { |
| 108 | if ($line =~ m/^Session Time:/) { |
115 | if ($line =~ m/^Session Time:/ || $line =~ m/^Session Start:/) { |
| 109 | #print $line; |
116 | #print $line; |
| 110 | $datetimenice = $line; |
117 | $datetimenice = $line; |
| 111 | $datetimenice =~ s/Session Time: //g; |
118 | $datetimenice =~ s/Session Time: //g; |
| - | 119 | $datetimenice =~ s/Session Start: //g; |
|
| 112 | $datetimenice =~ s/\n//g; |
120 | $datetimenice =~ s/\n//g; |
| 113 | $datetimenice =~ s/\r//g; |
121 | $datetimenice =~ s/\r//g; |
| 114 | 122 | ||
| 115 | $datetime = $line; |
123 | $datetime = $line; |
| 116 | $datetime =~ s/Session Time: //g; |
124 | $datetime =~ s/Session Time: //g; |
| - | 125 | $datetime =~ s/Session Start: //g; |
|
| 117 | $datetime =~ s/://g; |
126 | $datetime =~ s/://g; |
| 118 | $datetime =~ s/\n//g; |
127 | $datetime =~ s/\n//g; |
| 119 | $datetime =~ s/\r//g; |
128 | $datetime =~ s/\r//g; |
| 120 | $datetime =~ s/ /_/g; |
129 | $datetime =~ s/ /_/g; |
| 121 | $datetime = lc($datetime); |
130 | $datetime = lc($datetime); |
| 122 | 131 | ||
| 123 | if ($currentfile) { |
132 | if ($currentfile) { |
| 124 | if ($debugmode == 0) { |
133 | if ($debugmode == 0) { |
| 125 | print OUTFILE "\n\\\\\nNext page: [[".$datetime."]] \\\\ \n"; |
134 | print OUTFILE "\n\\\\\nNext page: [[".$datetime."]] \\\\ \n"; |
| 126 | print OUTFILE "Back to index: [[".$namespace."]] \\\\ \n"; |
135 | print OUTFILE "Back to index: [[".$namespace."]] \\\\ \n"; |
| - | 136 | close(OUTFILE); |
|
| 127 | 137 | ||
| - | 138 | $fileopenerr = 0; |
|
| - | 139 | copy($outputpath.$currentfile, $outputpath."yesterday.txt") or $fileopenerr = 1; |
|
| - | 140 | if ($fileopenerr == 1) { |
|
| - | 141 | print "Could not copy yesterday.txt-log"; |
|
| - | 142 | } |
|
| 128 | } |
143 | } |
| 129 | } |
144 | } |
| 130 | 145 | ||
| 131 | $currentfile = $datetime .".txt"; |
146 | $currentfile = $datetime .".txt"; |
| 132 | # skriv $datetimenice och $datetime till $contentspath |
147 | # skriv $datetimenice och $datetime till $contentspath |
| 133 | $fileopenerr = 0; |
148 | $fileopenerr = 0; |
| 134 | open (CONTENTSFILE, "<".$contentspath) or $fileopenerr = 1; |
149 | open (CONTENTSFILE, "<".$contentspath) or $fileopenerr = 1; |
| 135 | if ($fileopenerr == 0) { |
150 | if ($fileopenerr == 0) { |
| 136 | @contentsfilecontents = <CONTENTSFILE>; |
151 | @contentsfilecontents = <CONTENTSFILE>; |
| 137 | close(CONTENTSFILE); |
152 | close(CONTENTSFILE); |
| 138 | if ($debugmode == 0) { |
153 | if ($debugmode == 0) { |
| 139 | open (CONTENTSFILE, ">".$contentspath) or $fileopenerr = 1; |
154 | open (CONTENTSFILE, ">".$contentspath) or $fileopenerr = 1; |
| 140 | if ($fileopenerr == 0) { |
155 | if ($fileopenerr == 0) { |
| 141 | print CONTENTSFILE "[[$namespace$datetime|$datetimenice]] \\\\ \n"; |
156 | print CONTENTSFILE "[[$namespace$datetime|$datetimenice]] \\\\ \n"; |
| 142 | foreach (@contentsfilecontents) { |
157 | foreach (@contentsfilecontents) { |
| 143 | print CONTENTSFILE $_; |
158 | print CONTENTSFILE $_; |
| 144 | } |
159 | } |
| 145 | close(CONTENTSFILE); |
160 | close(CONTENTSFILE); |
| 146 | } |
161 | } |
| 147 | } |
162 | } |
| 148 | } else { |
163 | } else { |
| 149 | exit; |
164 | exit; |
| 150 | } |
165 | } |
| 151 | 166 | ||
| 152 | if ($debugmode == 0) { |
167 | if ($debugmode == 0) { |
| 153 | $fileopenerr = 0; |
168 | $fileopenerr = 0; |
| 154 | open (OUTFILE, ">>".$outputpath.$currentfile) or $fileopenerr = 1; |
169 | open (OUTFILE, ">>".$outputpath.$currentfile) or $fileopenerr = 1; |
| 155 | if ($fileopenerr == 1) { |
170 | if ($fileopenerr == 1) { |
| 156 | print "Could not open ".$outputpath."/".$currentfile; |
171 | print "Could not open ".$outputpath."/".$currentfile; |
| 157 | exit; |
172 | exit; |
| 158 | } |
173 | } |
| 159 | } |
174 | } |
| 160 | if ($currentfile) { |
175 | if ($currentfile) { |
| 161 | if ($debugmode == 0) { |
176 | if ($debugmode == 0) { |
| 162 | print OUTFILE "====== ".$datetimenice." ======\n"; |
177 | print OUTFILE "====== ".$datetimenice." ======\n"; |
| 163 | } |
178 | } |
| 164 | } |
179 | } |
| 165 | #print $datetime; |
180 | #print $datetime; |
| 166 | } |
181 | } |
| 167 | 182 | ||
| 168 | elsif ($currentfile) { |
183 | elsif ($currentfile) { |
| 169 | $parsedLine = $line; |
184 | $parsedLine = $line; |
| 170 | $parsedLine =~ s/\n//g; |
185 | $parsedLine =~ s/\n//g; |
| 171 | $parsedLine =~ s/\r//g; |
186 | $parsedLine =~ s/\r//g; |
| 172 | #$parsedLine = $parsedLine; |
187 | #$parsedLine = $parsedLine; |
| 173 | 188 | ||
| 174 | #<color #aaaaaa> |
189 | #<color #aaaaaa> |
| 175 | #</color> |
190 | #</color> |
| 176 | 191 | ||
| 177 | $nickLine = $parsedLine; |
192 | $nickLine = $parsedLine; |
| 178 | if ($nickLine =~ m/.*<(\w{1,9})>.*/) { |
193 | if ($nickLine =~ m/.*<(\w{1,9})>.*/) { |
| 179 | $nick = $1; |
194 | $nick = $1; |
| 180 | $nickVal = 0; |
195 | $nickVal = 0; |
| 181 | my @chars = split //, $nick; |
196 | my @chars = split //, $nick; |
| 182 | foreach my $char (@chars) { |
197 | foreach my $char (@chars) { |
| 183 | #for ($i = 0; $i < length($nick); $i++) { |
198 | #for ($i = 0; $i < length($nick); $i++) { |
| 184 | #$charval = ord(substr($nick, $i, 1)); |
199 | #$charval = ord(substr($nick, $i, 1)); |
| 185 | $nickVal += ord($char); |
200 | $nickVal += ord($char); |
| 186 | #$nickVal += $charval; |
201 | #$nickVal += $charval; |
| 187 | 202 | ||
| 188 | } |
203 | } |
| 189 | #$temp = $nickVal; |
204 | #$temp = $nickVal; |
| 190 | $nickVal = ($nickVal) % $nrofcolors; |
205 | $nickVal = ($nickVal) % $nrofcolors; |
| 191 | #$nickB = sprintf("%x", ((($nickVal & 7)**2)*2.3+5)); |
206 | #$nickB = sprintf("%x", ((($nickVal & 7)**2)*2.3+5)); |
| 192 | #$nickG = sprintf("%x", (((($nickVal >> 3) & 7)**2.3)*2+5)); |
207 | #$nickG = sprintf("%x", (((($nickVal >> 3) & 7)**2.3)*2+5)); |
| 193 | #$nickR = sprintf("%x", (((($nickVal >> 6) & 7)**2.3)*2+5)); |
208 | #$nickR = sprintf("%x", (((($nickVal >> 6) & 7)**2.3)*2+5)); |
| 194 | #if (length($nickB) == 1) { |
209 | #if (length($nickB) == 1) { |
| 195 | # $nickB = "0".$nickB; |
210 | # $nickB = "0".$nickB; |
| 196 | #} |
211 | #} |
| 197 | #if (length($nickG) == 1) { |
212 | #if (length($nickG) == 1) { |
| 198 | # $nickG = "0".$nickG; |
213 | # $nickG = "0".$nickG; |
| 199 | #} |
214 | #} |
| 200 | #if (length($nickR) == 1) { |
215 | #if (length($nickR) == 1) { |
| 201 | # $nickR = "0".$nickR; |
216 | # $nickR = "0".$nickR; |
| 202 | #} |
217 | #} |
| 203 | 218 | ||
| 204 | #print "$nick $temp $nickVal $colors[$nickVal] \n"; |
219 | #print "$nick $temp $nickVal $colors[$nickVal] \n"; |
| 205 | #$color = "#$nickR$nickG$nickB"; |
220 | #$color = "#$nickR$nickG$nickB"; |
| 206 | $parsedLine =~ s/<$nick>/<color $colors[$nickVal]><$nick><\/color>/; |
221 | $parsedLine =~ s/<$nick>/<color $colors[$nickVal]><$nick><\/color>/; |
| 207 | #print $nick." ".$nickVal."\n"; |
222 | #print $nick." ".$nickVal."\n"; |
| 208 | #print $parsedLine ."\n"; |
223 | #print $parsedLine ."\n"; |
| 209 | } |
224 | } |
| - | 225 | ||
| - | 226 | #$parsedLine =~ s/\/\//\//g; |
|
| - | 227 | $parsedLine =~ s/''/'/g; |
|
| - | 228 | $parsedLine =~ s/\[\[/\[/g; |
|
| - | 229 | $parsedLine =~ s/\]\]/\]/g; |
|
| - | 230 | $parsedLine =~ s/\(\(/\(/g; |
|
| - | 231 | $parsedLine =~ s/\)\)/\)/g; |
|
| - | 232 | $parsedLine =~ s/____/_/g; |
|
| - | 233 | $parsedLine =~ s/___/_/g; |
|
| - | 234 | $parsedLine =~ s/__/_/g; |
|
| - | 235 | $parsedLine =~ s/\*\*/\*/g; |
|
| 210 | 236 | ||
| 211 | $parsedLine =~ s/\x{e5}/å/g; |
237 | $parsedLine =~ s/\x{e5}/å/g; |
| 212 | $parsedLine =~ s/\x{e4}/ä/g; |
238 | $parsedLine =~ s/\x{e4}/ä/g; |
| 213 | $parsedLine =~ s/\x{f6}/ö/g; |
239 | $parsedLine =~ s/\x{f6}/ö/g; |
| 214 | $parsedLine =~ s/\x{c5}/Å/g; |
240 | $parsedLine =~ s/\x{c5}/Å/g; |
| 215 | $parsedLine =~ s/\x{c4}/Ä/g; |
241 | $parsedLine =~ s/\x{c4}/Ä/g; |
| 216 | $parsedLine =~ s/\x{d6}/Ö/g; |
242 | $parsedLine =~ s/\x{d6}/Ö/g; |
| 217 | 243 | ||
| 218 | $parsedLine =~ s/\[wiki\]/**[wiki]**/g; |
244 | $parsedLine =~ s/\[wiki\]/**[wiki]**/g; |
| 219 | $parsedLine =~ s/\[svn\]/**[svn]**/g; |
245 | $parsedLine =~ s/\[svn\]/**[svn]**/g; |
| 220 | 246 | ||
| 221 | $parsedLine .= " "; |
247 | $parsedLine .= " "; |
| 222 | $parsedLine =~ s/http:\/\/projekt\.auml\.se\/( |
248 | $parsedLine =~ s/http:\/\/projekt\.auml\.se\/(\S+)/[[:$1]] /g; |
| 223 | 249 | ||
| 224 | $parsedLine .= "\\\\"."\n"; |
250 | $parsedLine .= "\\\\"."\n"; |
| 225 | if ($debugmode == 0) { |
251 | if ($debugmode == 0) { |
| 226 | print OUTFILE $parsedLine; |
252 | print OUTFILE $parsedLine; |
| 227 | } |
253 | } |
| 228 | } |
254 | } |
| 229 | #print $store; |
255 | #print $store; |
| 230 | 256 | ||
| 231 | } |
257 | } |
| 232 | $linecnt++; |
258 | $linecnt++; |
| - | 259 | } |
|
| - | 260 | close(OUTFILE); |
|
| - | 261 | ||
| - | 262 | $fileopenerr = 0; |
|
| - | 263 | copy($outputpath.$currentfile, $outputpath."today.txt") or $fileopenerr = 1; |
|
| - | 264 | if ($fileopenerr == 1) { |
|
| - | 265 | print "Could not copy today.txt-log"; |
|
| 233 | } |
266 | } |
| 234 | 267 | ||
| 235 | if ($debugmode == 0) { |
268 | if ($debugmode == 0) { |
| 236 | $fileopenerr = 0; |
269 | $fileopenerr = 0; |
| 237 | open (LINENR, ">".$linenrpath) or $fileopenerr = 1; |
270 | open (LINENR, ">".$linenrpath) or $fileopenerr = 1; |
| 238 | if ($fileopenerr == 0) { |
271 | if ($fileopenerr == 0) { |
| 239 | print LINENR $linecnt; |
272 | print LINENR $linecnt; |
| 240 | close(LINENR); |
273 | close(LINENR); |
| 241 | } |
274 | } |
| 242 | } |
275 | } |
| 243 | 276 | ||
| 244 | if ($debugmode == 0) { |
277 | if ($debugmode == 0) { |
| 245 | $fileopenerr = 0; |
278 | $fileopenerr = 0; |
| 246 | open (CURRFILE, ">".$currentfilepath) or $fileopenerr = 1; |
279 | open (CURRFILE, ">".$currentfilepath) or $fileopenerr = 1; |
| 247 | if ($fileopenerr == 0) { |
280 | if ($fileopenerr == 0) { |
| 248 | print CURRFILE $currentfile; |
281 | print CURRFILE $currentfile; |
| 249 | close(CURRFILE); |
282 | close(CURRFILE); |
| 250 | } else { |
283 | } else { |
| 251 | print "Could not open ".$currentfilepath; |
284 | print "Could not open ".$currentfilepath; |
| 252 | exit; |
285 | exit; |
| 253 | } |
286 | } |
| 254 | } |
287 | } |
| 255 | 288 | ||
| 256 | if ($debugmode == 0) { |
289 | if ($debugmode == 0) { |
| 257 | $fileopenerr = 0; |
290 | $fileopenerr = 0; |
| 258 | open (CONTENTSFILE, "<".$contentspath) or $fileopenerr = 1; |
291 | open (CONTENTSFILE, "<".$contentspath) or $fileopenerr = 1; |
| 259 | if ($fileopenerr == 0) { |
292 | if ($fileopenerr == 0) { |
| 260 | open (NICECONTENTSFILE, ">".$contentsfileoutput.$contentsfilename) or $fileopenerr = 1; |
293 | open (NICECONTENTSFILE, ">".$contentsfileoutput.$contentsfilename) or $fileopenerr = 1; |
| 261 | if ($fileopenerr == 0) { |
294 | if ($fileopenerr == 0) { |
| 262 | @contentsfilecontents = <CONTENTSFILE>; |
295 | @contentsfilecontents = <CONTENTSFILE>; |
| 263 | print NICECONTENTSFILE $contentsheader; |
296 | print NICECONTENTSFILE $contentsheader; |
| 264 | foreach (@contentsfilecontents) { |
297 | foreach (@contentsfilecontents) { |
| 265 | print NICECONTENTSFILE $_; |
298 | print NICECONTENTSFILE $_; |
| 266 | } |
299 | } |
| 267 | close(NICECONTENTSFILE); |
300 | close(NICECONTENTSFILE); |
| 268 | } else { |
301 | } else { |
| 269 | print "Could not open ".$contentsfileoutput.$contentsfilename; |
302 | print "Could not open ".$contentsfileoutput.$contentsfilename; |
| 270 | exit; |
303 | exit; |
| 271 | } |
304 | } |
| 272 | close(CONTENTSFILE); |
305 | close(CONTENTSFILE); |
| 273 | } else { |
306 | } else { |
| 274 | print "Could not open ".$contentspath; |
307 | print "Could not open ".$contentspath; |
| 275 | exit; |
308 | exit; |
| 276 | } |
309 | } |
| 277 | } |
310 | } |
| 278 | 311 | ||
| 279 | #print $linecnt-1 ." - ". $line; |
312 | #print $linecnt-1 ." - ". $line; |
| 280 | - | ||
| 281 | - | ||
| 282 | - | ||
| 283 | - | ||
| 284 | - | ||
| 285 | - | ||
| 286 | - | ||
| 287 | 313 | ||