/[webpac]/branches/drustvene/import_xml/convert_delimiter.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /branches/drustvene/import_xml/convert_delimiter.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 335 - (hide annotations)
Wed Jun 2 16:13:57 2004 UTC (16 years, 9 months ago) by dpavlin
File MIME type: text/plain
File size: 571 byte(s)
added two new braches

1 dpavlin 280 #!/usr/bin/perl -w
2    
3     use strict;
4    
5    
6     foreach my $file (@ARGV) {
7    
8     open(XML,$file) || die "can't open '$file': $!";
9    
10     my $xml;
11     while (<XML>) {
12     $xml .= $_;
13     }
14    
15     close(XML);
16    
17 dpavlin 287 if ($xml =~ s,<(\w+)(\s+[^>]*)delimiter\s*=\s*"(\s[^"]+|[^"]+\s)"([^>]*)>(.*?)</\1>,<$1$2$4>\n\t\t\t<delimiter>$3</delimiter>\n\t\t\t<value>$5</value>\n\t\t</$1>,gis) {
18 dpavlin 280 open(XML,"> $file-new") || die "can't create '$file-new': $!";
19     print XML $xml;
20     close(XML);
21    
22     rename "$file-new","$file" || die "can't update original file '$file' with '$file-new': $!";
23    
24     print "$file converted\n";
25     }
26     }
27    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26