I need to format it to look like this[get4] $uri=/LRA/RiskApplicationPage.aspx $method=GET [get5] $uri=/LRA/CSS/RiskManagement.css $method=GET
I want to take the text following the last / and copy it to the inside of the get before it. This is how I'm currently attempting it...[RiskApplicationPage.aspx get4] $uri=/LRA/RiskApplicationPage.aspx $method=GET [RiskManagement.css get5] $uri=/LRA/CSS/RiskManagement.css $method=GET
Any suggestions? Thanks#!C:\Perl\bin\perl -w use Getopt::Std; $USAGE = <<USAGE; Usage: Absolute_Path\\file A script to adjust the request ID and replace it with something a little more descriptive USAGE ; # process command line getopts('x') || die $USAGE; # get parameters $script = shift || die $USAGE; # rename .tst file to a .txt file chomp ($script); my $temp = $script; $temp =~ s/\.tsv$//; $new_script = join("", $temp, ".txt"); rename ($script, $new_script); open (DATA, "$new_script") || die "Error: Couldn't open $new_script : $!\n"; while(<DATA>) { push @Array, $_; } foreach $_ (@Array) { if ($_ =~ /^\[get/) { $_ = join("", $_, "TEST"); print $_; } }
In reply to Need RegEx assistance by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |