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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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)) {...
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...
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...
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.