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 strongm 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. learingperl01

    Saving print data to a variable

    Hello, Can't figure out how to save something which I am currently printing to a variable. I have to captures ()() which I am converting data in the second capture from hex Thanks for the help. Example: while ( $string =~ /(capture1)(capture2)/g ) { print "$1".chr(hex($2)); #Trying...
  2. learingperl01

    Readdir large number of files and mod each file

    Gotcha thanks I'll give that a go and see what happens. Thanks for the help again.
  3. learingperl01

    Readdir large number of files and mod each file

    Sorry for the confusion. Let me try to explain once more hopefully it makes more sense. All the files with the name ending with :rtsd001 contains data which I have to reprocess minus all the lines before the line STRUC for example: sample file.rtsd001 contents: data data blah blah date time...
  4. learingperl01

    Readdir large number of files and mod each file

    Thanks for the quick reply. The only thing I forgot to mention is that all the files that end with the extension of "rtsd001" will contain the "/STRUC20/" so every since file will need to be printed out with the lines prior to that. So would the line below still be required? $struc20seen=1 if...
  5. learingperl01

    Readdir large number of files and mod each file

    Hello Perl experts, I am pretty new to Perl and having a memory problem with my code. I have narrowed it down to the following section of my code which always seems to generated the out of memory error when running. opendir (TXT, "$processedDirPath") or die "Cannot open...
  6. learingperl01

    How to look for 2 regex and print all preciding data

    Hello everyone, I am hoping someone can shed some light/point me in the right direction. I am trying to figure out how to search for the 1st occurrences of two strings and once they are found print all previous data. Below is some sample data which I would be working with, any pointers etc...
  7. learingperl01

    Perl -M to check file modified time not working

    Thanks for the quick reply. the print statement that I am doing DOES show that files are present. Changing the < .0416 to > .0416 still shows in correct results. In the directory I have placed two files one that is always gt a time I am using to test the script and on that is lt the time in...
  8. learingperl01

    Perl -M to check file modified time not working

    Hello everyone I am not sure why using the -M to check for files modified after a certain time is not working. Regardless of what time I change the < xxx entry to I get files that don't match that time criteria. Can someone please point me in the right direction, or let me know if there is a...
  9. learingperl01

    Search for regex within a boundary

    Kirsle, Thanks a lot for the help, that is exactly what I was looking to get back. Cheers mate.
  10. learingperl01

    Search for regex within a boundary

    Hello all, hoping someone can help me or point me in the right direction. I have a script which I currently use but running into some problems with the output that I am getting back. I've created a new script to try to figure out the part that I am having problems which is below. The...
  11. learingperl01

    Clarification of system,exec,fork

    Hello all I am trying to wrap my head around what the best way to call another perl script from within perl script is. exec was my first choice as I just want to call/run the second script (call it and let is run in the BG) and not have my current script wait for the script to finish before...
  12. learingperl01

    Printing entire file when regex matches

    Hello all I have a script that I am working on. I am trying to print the entire contents of a file when a regex match is found once instead of what $_ is holding after a match. So if a match is found I want to stop looking and just print the entire contents of the file. I am kinda stuck as...
  13. learingperl01

    Process set number of bytes at a time

    Hello, I was hoping someone could point me in the right direction/help me out with the following problem. I have the following code shown below. #!/usr/bin/perl use strict; use warnings; my $input_string = 'test'; my $hexchars = ''; foreach my $chars (split(//,$input_string)) {...
  14. learingperl01

    Regex only return the data that matches the regex

    Thanks for the tip, that really helped out. Cheers
  15. learingperl01

    Regex only return the data that matches the regex

    Hello perl experts, I am hoping that someone can point me in the right direction. I am running regex matches on a file which contains alpha numeric data. I am trying to figure out how to only match or print exactly what I am searching for instead of additional data. For example. while...
  16. learingperl01

    Perl Unpack function. Hex an input file

    Hello all, pretty new to unpack function in Perl. I am trying to take an input file read it and use unpack to create a HEX output of the entire file. The only problem is that when I compare the HEX values of the file I am reading with the output of unpack some of the value are not correct...
  17. learingperl01

    Print message perl number of regex matches

    no, trying to add some additional logic to my script. Didn't want to paste/copy my entire script for something this simple.
  18. learingperl01

    Print message perl number of regex matches

    Hello all, I am trying to figure out how to print a message depending on the number of regexes that were matched...either the count or the number that were matched. Example if I am running a initial if statement with 5 regex. Depending on the number of matched regex I would like to print a...
  19. learingperl01

    Regex match continue searching

    Good catch Kevin, that was the problem. Thanks!
  20. learingperl01

    Regex match continue searching

    Thanks for the reply. I have updated your regex but the outcome/results are the same. The main issues are: *That the script prints the entire line not just the url *if the URL continues to the next line then it cuts the URL/Link short. I guess I can check if the TLD's exist in the current...

Part and Inventory Search

Back
Top