. START ===== D:\ETL\ParseDb.cmd perl ParseDb.pl DbName.txt pause END ================== D:\ETL\ParseDb.cmd . START ===== D:\ETL\ParseDb.pl use strict ; package Class ; my $DbInputFile = $ARGV[0] ; my ( $DbName , $FileExtension ) = split ( '\.' , $DbInputFile ) ; my $DbOutputFile = "$DbInputFile\.out\.xml" ; sub main () { open ( FH_DbOutputFile , ">$DbOutputFile " ) or die " Cannot open $DbOutputFile " ; print FH_DbOutputFile "<DbName>$DbName \n"; my @Tables = {} ; # READ ALL ROWS TO LIST open (FH_DbInputFile,$DbInputFile); my @DbInputFile = <FH_DbInputFile>; close (FH_DbInputFile); foreach my $line ( @DbInputFile ) { #debug print "\$line is $line \n " ; my ($DbName , $TableName , $ColName) = split ( '\\t' , $line ) ; print "\$DbName , $DbName , \$TableName , $TableName , \$ColName , $ColName \n" ; print FH_DbOutputFile "<TableName>$TableName</TableName><ColumnName>$ColName</ColumnName>\n" ; } #eof foreach my $line ( @DbInputFile ) #call sub 1 #call su print FH_DbOutputFile "</DbName>\n" ; close FH_DbOutputFile ; } #eof sub main sub func1() { } sub new { my $self = {}; $self->{'buz'} = 42; bless $self; } #eof new const # action !!! main(); package SomeOtherPackage ; END ================== D:\ETL\ParseDb.pl . START ===== D:\ETL\DbName.txt.out.xml <DbName>DbName <TableName>TableName1</TableName><ColumnName>ColName1 </ColumnName> <TableName>TableName2</TableName><ColumnName>ColName2 </ColumnName> <TableName>TableName3</TableName><ColumnName>ColName3 </ColumnName> <TableName>TableName4</TableName><ColumnName>ColName4 </ColumnName> <TableName>TableName5</TableName><ColumnName>ColName5 </ColumnName> <TableName>TableName6</TableName><ColumnName>ColName6 </ColumnName> <TableName>TableName7</TableName><ColumnName>ColName7 </ColumnName> <TableName>TableName8</TableName><ColumnName>ColName8 </ColumnName> <TableName>TableName9</TableName><ColumnName>ColName9 </ColumnName> <TableName>TableName10</TableName><ColumnName>ColName10</ColumnName> </DbName> END ================== D:\ETL\DbName.txt.out.xml . START ===== D:\ETL\all.txt . START ===== D:\ETL\ParseDb.cmd perl ParseDb.pl DbName.txt pause END ================== D:\ETL\ParseDb.cmd . START ===== D:\ETL\ParseDb.pl use strict ; package Class ; my $DbInputFile = $ARGV[0] ; my ( $DbName , $FileExtension ) = split ( '\.' , $DbInputFile ) ; my $DbOutputFile = "$DbInputFile\.out\.xml" ; sub main () { open ( FH_DbOutputFile , ">$DbOutputFile " ) or die " Cannot open $DbOutputFile " ; print FH_DbOutputFile "<DbName>$DbName \n"; my @Tables = {} ; # READ ALL ROWS TO LIST open (FH_DbInputFile,$DbInputFile); my @DbInputFile = <FH_DbInputFile>; close (FH_DbInputFile); foreach my $line ( @DbInputFile ) { #debug print "\$line is $line \n " ; my ($DbName , $TableName , $ColName) = split ( '\\t' , $line ) ; print "\$DbName , $DbName , \$TableName , $TableName , \$ColName , $ColName \n" ; print FH_DbOutputFile "<TableName>$TableName</TableName><ColumnName>$ColName</ColumnName>\n" ; } #eof foreach my $line ( @DbInputFile ) #call sub 1 #call su print FH_DbOutputFile "</DbName>\n" ; close FH_DbOutputFile ; } #eof sub main sub func1() { } sub new { my $self = {}; $self->{'buz'} = 42; bless $self; } #eof new const # action !!! main(); package SomeOtherPackage ; END ================== D:\ETL\ParseDb.pl . START ===== D:\ETL\DbName.txt.out.xml <DbName>DbName <TableName>TableName1</TableName><ColumnName>ColName1 </ColumnName> <TableName>TableName2</TableName><ColumnName>ColName2 </ColumnName> <TableName>TableName3</TableName><ColumnName>ColName3 </ColumnName> <TableName>TableName4</TableName><ColumnName>ColName4 </ColumnName> <TableName>TableName5</TableName><ColumnName>ColName5 </ColumnName> <TableName>TableName6</TableName><ColumnName>ColName6 </ColumnName> <TableName>TableName7</TableName><ColumnName>ColName7 </ColumnName> <TableName>TableName8</TableName><ColumnName>ColName8 </ColumnName> <TableName>TableName9</TableName><ColumnName>ColName9 </ColumnName> <TableName>TableName10</TableName><ColumnName>ColName10</ColumnName> </DbName> END ================== D:\ETL\DbName.txt.out.xml . START ===== D:\ETL\all.txt . START ===== D:\ETL\ParseDb.cmd perl ParseDb.pl DbName.txt pause END ================== D:\ETL\ParseDb.cmd . START ===== D:\ETL\ParseDb.pl use strict ; package Class ; my $DbInputFile = $ARGV[0] ; my ( $DbName , $FileExtension ) = split ( '\.' , $DbInputFile ) ; my $DbOutputFile = "$DbInputFi END ================== D:\ETL\all.txt . START ===== D:\ETL\DbName.txt DbName1 TableName1 ColName1 DbName2 TableName2 ColName2 DbName3 TableName3 ColName3 DbName4 TableName4 ColName4 DbName5 TableName5 ColName5 DbName6 TableName6 ColName6 DbName7 TableName7 ColName7 DbName8 TableName8 ColName8 DbName9 TableName9 ColName9 DbName10 TableName10 ColName10 END ================== D:\ETL\DbName.txt
Getting the Current TabItem when the Tab is not selected in WPF
-
[image: Banner]
This is a quick reminder to self on how to retrieve a TabItem from a WPF
TabControl *when the tab is not currently selected* because I ru...
1 week ago
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!