Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Remove hyperlinks from the lines which have special character?

by Corion (Patriarch)
on Mar 13, 2017 at 08:56 UTC ( [id://1184371]=note: print w/replies, xml ) Need Help??


in reply to Remove hyperlinks from the lines which have special character?

There are no hyperlinks in your posted input file.

You can help us help you better by posting short, relevant input data.

Looking at your input and output as stated, the easiest approach would be to reject any line that starts with OVERALLSTATUS or PARTIALSTATUS.

Replies are listed 'Best First'.
Re^2: Remove hyperlinks from the lines which have special character?
by finddata (Sexton) on Mar 13, 2017 at 09:05 UTC

    Here am unable to fix the hyperlink line for lines.

    Yes you are absolutely right.I should omit the hyperlinks for the line starts with overall status and partial status.

      Ah. So the output you show is not the output your script actually generates.

      I would split up the task into two steps:

      1. Check whether a hyperlink should be added to a line
      2. Print the line with a hyperlink or print it without

      For the first step, you should write a subroutine needsHyperlink, which checks whether a line needs a hyperlink:

      sub needsHyperlink { my( $line ) = @_; ... # see perldoc perlre for checking }

      Then, you call that function to see whether you need to add a hyperlink in the output or not:

      my $outputHyperlink = needsHyperlink( $line ); if( $outputHyperlink ) { # print line with hyperlink } else { # print line without hyperlink, or maybe don't print it at all };

      Update: added second sentence about not printing things

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1184371]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-25 20:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found