Wednesday, June 6, 2012

How to Read File names from a DIR in PERL

#Reading files from the Directory
my $dir = 'C:\Users\philip\Desktop\sample_files';
 opendir(DIR, $dir) or die $!;
 while (my $file = readdir(DIR)) {
        # Use a regular expression to ignore files beginning with a period
        next if ($file =~ m/^\./);
 print "$file\n";
    }
    closedir(DIR);

Dumping CSV files to SQL tables.

Select Import and Export data, by using this you can export any type of datas to your tables.

If you are using window authentication while accessing the tables then you should open this tool by the corresponding net user.

C:\Users\philip\Desktop>runas /netonly /user:DOMAIN\USERNAME "C:\Program Files\Microsoft SQL Server\100\DTS\Binn\DTSWizard.exe"
Enter the password for DOMAIN\USERNAME :