Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. sycoogtit

    Removing entries from a file

    I agree that the rules are a little confusing. Assuming AAAAAA should be deleted, then how about this. #!/usr/bin/perl use strict; my @foo = ('AAAAAA', 'ATATAT', 'AATAAT'); foreach (@foo) { print "$_\n" if substr($_,0,3) eq substr($_,3,6); } -- http://MyUniversityTutor.com
  2. sycoogtit

    How to delete a line in excel file ???

    If you have an array @a in perl(< 6), then you access the ith element with $a[$i] instead of @a[$i]. That's all the warning is saying. I think that changes with perl6... I've never used Spreadsheet::ParseExcel::Simple, but I think you can check the value of the LAVG_1min column with $data[2]...
  3. sycoogtit

    How to add and delete an occurrence of characters in a file?

    The only major difference I can see is the global option. -- http://MyUniversityTutor.com
  4. sycoogtit

    How do I find all regex matches in a string?

    Have you looked at the module? You're using SQL, and Class::DBI is a module that deals with SQL. I was just saying that if you're using Class::DBI, then you don't have to issue a statement and look for errors. You can just override the _croak function and you'll get all the errors. If you're not...
  5. sycoogtit

    How do I find all regex matches in a string?

    If you're using Class::DBI then you just override the _croak function. http://search.cpan.org/~tmtm/Class-DBI-v3.0.17/lib/Class/DBI.pm#EXCEPTIONS -- http://MyUniversityTutor.com
  6. sycoogtit

    How do I find &amp; delete old files?

    What OS are you on? Do you have to use perl? If you're on Linux, you can just do this from the shell: find * -mtime +89 If you're on Windows or you have to use perl, then you can use File::Find and stat. -- http://MyUniversityTutor.com
  7. sycoogtit

    How to get the PID when a process is started by &quot;system&quot;?

    I've never done it before, but check out this post. There are a lot of suggestions -- I'm sure one of them will work for you. http://www.perlmonks.org/?node_id=680907 -- http://MyUniversityTutor.com
  8. sycoogtit

    Grep testing expression within subroutine

    Okay, I see what's going on. grep returns the elements of the list when the expression returns true. Your 2nd snippet actually modifies @input, evaluates to true, and returns that element. The 1st snippet just does some irrelevant calculations, evaluates to true, and returns the element from...
  9. sycoogtit

    Grep testing expression within subroutine

    Hm. That's pretty weird. I'm not sure what's going on there, but I can tell you that this isn't how grep is supposed to be used -- it's used to find stuff in a list, but not operate on it. I think what you want is map. Check out these examples. Sorry I can't tell you about the weird results...
  10. sycoogtit

    Grouping based on hostname

    Does that mean you don't want to do this in perl anymore? If you still need help, then show us what you have in shell scripting and we can help you port it to perl, or show us what you have in perl so far and we can help you build on that. -- http://MyUniversityTutor.com
  11. sycoogtit

    writing Header content only one time while merging multiple excel file

    I'm glad it's working! Thanks for the stars. -- http://MyUniversityTutor.com
  12. sycoogtit

    writing Header content only one time while merging multiple excel file

    Try this. # Build an array of the stats type to be collated #my @stat_type=split(/:/, $PARAMS{COLLATE_STAT_TYPES}); @stat_type=@uniq; # for each of the stats type, read the xls of each hour and write into a consolidated xls. foreach my $stat_type_token (@stat_type){ my $con_wb =...
  13. sycoogtit

    writing Header content only one time while merging multiple excel file

    It looks like you're missing a '{' at the end of this line foreach my $row_index ($source_sheet->{MinRow} .. $source_sheet->{MaxRow}) It also looks like you're setting $first_file to 'no' outside of the loop. Try fixing your indentation so it's easier for you (and us) to read. --...
  14. sycoogtit

    Use PERL to run subroutine in MS Access database

    I don't use windows, so I've never used Win32::OLE and I don't know what a subroutine in an mdb file would look like. If you can post the file, then I can start playing around and see if I can figure something out. -- http://MyUniversityTutor.com
  15. sycoogtit

    writing Header content only one time while merging multiple excel file

    Oops. Looks like next if $row_index == $source_sheet->{MinRow} && $first_file ne "no"; should be next if $row_index == $source_sheet->{MinRow} && $first_file eq "no"; You're also changing $first_file to 'no' at the end of the loop, right? What's this line for? next if $row_index ==...
  16. sycoogtit

    Regex Question

    You're right, it's trying to find the smallest possible match when you use '?'. Look at it from left to right: $s = '-html=-head=head data-head=-body=BODY-body=-html='; DISCLAIMER I'm sure this isn't the actual way Perl does goes about pattern matching, but this is what I say to myself as...
  17. sycoogtit

    simple but annoying problem

    You just need to get rid of some parentheses. while($read=~/(NM|\s\*\s)/g){ The way you have it, 'NM' will be saved in $1 and '*' will be saved in $2. -- http://MyUniversityTutor.com
  18. sycoogtit

    Use PERL to run subroutine in MS Access database

    When you say that neither of them work, what exactly do you mean? They give you no output? They die with errors? Can you post that access file? I don't have access. -- http://MyUniversityTutor.com
  19. sycoogtit

    writing Header content only one time while merging multiple excel file

    You have this line next if $row_index eq (($source_sheet->{MinRow}) && ($first_file ne "no")); That looks odd. I think you want next if $row_index == $source_sheet->{MinRow} && $first_file ne "no"; I can't see where you're changing $first_file from "yes" to "no". You could make it the...
  20. sycoogtit

    Perl script can't locate RRDs.pm

    Is there a particular reason you've chosen that over a CPAN module? If not, I'd look into CPAN. CPAN modules are easy to install too. If you have to use this particular tool, then try to use yum rather than doing everything manually. You could, for instance: sudo yum install rrdtool sudo yum...

Part and Inventory Search

Back
Top