User Profile

Collapse

Profile Sidebar

Collapse
ezechiel
ezechiel
Last Activity: May 13 '11, 01:39 PM
Joined: Jul 20 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • ezechiel
    replied to excel: select 50% randomly of cells
    Hi,

    just tested this and this is: EXCELLENT ^^
    Thansk a lot. I'll dive into the code to adapt it to my needs.
    But thanks again, great job!!
    See more | Go to post

    Leave a comment:


  • ezechiel
    started a topic excel: select 50% randomly of cells

    excel: select 50% randomly of cells

    I've been looking for this on the forum, but didn't find anything in relation with excel.

    So, I have cells with text, from A3 -> A159
    And I need to select 50% (or 25% or 12.5%) of these cells randomly.
    I also need a function to select 10 cells randomly.

    Anyone has an idea how I could do this?
    See more | Go to post

  • :)

    well, you demonstrated efficiently :)
    thanks!
    See more | Go to post

    Leave a comment:


  • Hey,

    thanks for the hint! It was not very nice to repeat "your choice" every time. So i had to find the solution to display "choice not valid" in case of just hitting enter. Tried some things and here is the solution:

    [CODE=perl]if (!$soft || !(grep (/$soft/i, @soft_list))) {
    do{
    print "\n\nYour choice is not valid.\nPlease enter a valid choice (a/h/x/e/w/n/q):\n";...
    See more | Go to post

    Leave a comment:


  • chomp($var = <>) Hitting enter directly ends the script...

    Hi, while testing the program (runs in DOS), I thought "if someone hits enter without typing a letter before, what happens?"

    I tested and the script ends.. Is this normal, or how can I avoid this?

    [CODE=perl]print "To which analytical division is the study belonging to?\n\n";
    print "\ti: Immunology\n";
    print "\tc: Chemistry\n";
    print "\tq: Quit\n";...
    See more | Go to post

  • ezechiel
    replied to Find::File error: Invalid Top Directory
    in Perl
    ok,
    thanks for all this precious info Ron ;)
    It helped me a lot!
    See more | Go to post

    Leave a comment:


  • ezechiel
    replied to Find::File error: Invalid Top Directory
    in Perl
    ok, thanks for the info. I'll check out the substr() function.

    About this one:
    Code:
    open my $LOG, '>>', $logfile or die "Can't open <$logfile> $!";
    Don't I need to close the log at the end? I suppose it is like this?:
    Code:
    close $LOG;
    See more | Go to post

    Leave a comment:


  • ezechiel
    replied to Find::File error: Invalid Top Directory
    in Perl
    Well, all I have to say is .. thank you very much!!!!

    It works great and the script is 2x smaller.
    And POSIX strftime is easier to work with than the other one.

    And I also learned new things about logging and the print command!
    Thanks again!!! This is what I call a great answer to a problem ^^
    See more | Go to post

    Leave a comment:


  • ezechiel
    replied to Find::File error: Invalid Top Directory
    in Perl
    (If I could edit my posts after an hour, there wouldn't be 4 posts ^^)

    So, every change I made has been detailed (changes of the $homedir var and changes of the Attrib part). I don't see what I forgot?

    The value I'm working on for $homedir is actually a directory (not a mapped drive) and permissions have been set. I posted what worked and what not, and the reason I think why (may be completely wrong). What I understood...
    See more | Go to post

    Leave a comment:


  • ezechiel
    replied to Find::File error: Invalid Top Directory
    in Perl
    Update: (sorry about all those updates, but I continue searching)

    about attrib..: attrib is working properly
    it should be this:
    Code:
    my $myfile = "$homedir/$File::Find::name";
    my $attrib = get_attribs($myfile);
    so, the only question left is the File::Find error (as stated in the subject ^^ )
    See more | Go to post

    Leave a comment:


  • ezechiel
    replied to Find::File error: Invalid Top Directory
    in Perl
    Another edit:
    But it works with $homedir = "c:" (well, it doesn't work properly but it doesn't give an error)

    I made a check: 15 target files, non hidden, all in log. Changed 1 to hidden.
    The log still lists 15 files.

    Could be two reasons:
    - attrib function is not working properly
    - the hidden attribute "H" is not in the second place as I saw on a site. But print $attrib...
    See more | Go to post

    Leave a comment:


  • ezechiel
    replied to Find::File error: Invalid Top Directory
    in Perl
    Another edit:
    on my local machine, where everything was working, it didn't worked with
    $homedir = "c:/" or eany other dir

    But it works with $homedir = "c:"

    Ok, well, I found another error in my script..
    ยจ$homedir is not working at all.. except if $homedir = the directory where the script is located, then the script functions.

    I also noticed a problem with...
    See more | Go to post

    Leave a comment:


  • ezechiel
    started a topic Find::File error: Invalid Top Directory
    in Perl

    Find::File error: Invalid Top Directory

    hi, I have the following error on a win server:
    "Invalid Top Directory perl/lib/file/find.pm line 598

    Here's the code and I'll explain what I found until now:
    Code:
    #!/usr/bin/perl
    #
    use strict;
    use warnings;
    use File::Find;
    use MSDOS::Attrib qw(get_attribs set_attribs);
    
    (my $sec, my $min, my $hour, my $mday, my $mon, my $year, my $wday, my $yday, my $isdst)=localtime(time);
    ...
    See more | Go to post

  • ezechiel
    replied to File::Find package
    in Perl
    I don't know, but isn't it possible to put the directories of \\ipaddress in a list and then do a find in that list?

    But I don't know if this works (just starting with Perl):
    Code:
    my $homedir = "\\\\ipaddress";
    opendir (IMD, $homedir) or die "Couldn't find dir: IMD ($!)";
    my @thefiles= readdir(IMD);
    closedir(IMD);
    See more | Go to post

    Leave a comment:


  • ezechiel
    replied to problem with spaces in directory name
    in Perl
    Hi,

    thanks for the hints Ron!

    Is there any advantage to using perl modules rather than system calls?
    (-> does using modules asks more memory or something in order to load the module? Sorry 'bout the question, but I don't know very well how Perl interacts with the system and hardware).
    See more | Go to post

    Leave a comment:


  • ezechiel
    replied to problem with spaces in directory name
    in Perl
    Ok,

    using double quotes for this one solves the $1 problem,
    but now I have the problem again with DOS not accepting the parameters.

    For DOS, I have no other choice than using \"Project Information\"
    or have I?
    See more | Go to post

    Leave a comment:


  • ezechiel
    replied to problem with spaces in directory name
    in Perl
    Well,

    Code:
    #!/usr/local/bin/perl
    #
    use strict;
    use warnings;
    my $homedir = "c:/SCRIPT";
    opendir (IMD, $homedir) or die "Couldn't find dir: IMD ($!)";
    my @thefiles= readdir(IMD);
    closedir(IMD);
    
    my $x=0;
    #create a list of ".1" directories
    foreach my $f (@thefiles){    
         if($f =~ /(.+)(\.1$)/i && $f !~ /^\./i){
    ...
    See more | Go to post

    Leave a comment:


  • ezechiel
    started a topic problem with spaces in directory name
    in Perl

    problem with spaces in directory name

    Hi everyone,

    I have a question about spaces in directory names.
    If I want to use mkdir something, everything works out, but in this case:
    Code:
    #!/usr/local/bin/perl
    #
    use warnings;
    
    $homedir = "C:/SCRIPT/CJ0249A.1/\"Project Information\"";
    $file = "$homedir/exist.txt";
    
    if (-e "$file")
    {
            print ("it exists");
    ...
    See more | Go to post

  • ezechiel
    replied to multiple input mask
    Ok,

    thanks for the answers people!! I think every solution has been covered here.
    You just made the first interesting post (with solution) on the internet concerning this problem!!! (I googled around a lot, but every time, people suggest to use two textboxes, add a field in DB or other stuff.)

    So, finally a couple of usefull answers! :D

    Thanks again!
    See more | Go to post

    Leave a comment:


  • ezechiel
    replied to Report_CurrentRecord(): bad txt behaviour
    ok, i'll try these things out and will come back with the result later.
    Thanks :)
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...