Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

How to remove the spaces after the directory name and before the .html extension from my code using perl?

by gpssana (Initiate)
on Apr 13, 2017 at 05:04 UTC ( [id://1187823]=perlquestion: print w/replies, xml ) Need Help??

gpssana has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on How to remove the spaces after the directory name and before the .html extension from my code using perl?
  • Select or Download Code

Replies are listed 'Best First'.
Re: How to remove the spaces after the directory name and before the .html extension from my code using perl?
by poj (Abbot) on Apr 13, 2017 at 09:19 UTC

    Looks like you have created the .txt files and the folder they are in with a trailing space in the name so the problem is in code you have not shown.

    poj
Re: How to remove the spaces after the directory name and before the .html extension from my code using perl?
by Anonymous Monk on Apr 13, 2017 at 05:49 UTC

    Her %20 represents space.Why space is appended at the end of the folder and before the .html extension.Where should i change my code in my script?

    Use Basic debugging checklist its very powerful

Re: How to remove the spaces after the directory name and before the .html extension from my code using perl?
by Corion (Patriarch) on Apr 13, 2017 at 09:14 UTC

    Most likely, you read the space already in from your file into $line and then @data. Remove the spaces from the file.

      $word=~s/("\S+|\S+|")\s*/$1/g;
      I had used the above thing to remove the spaces .

        And did that remove all spaces from $word?

        How did you verify that that removed all spaces from $word?

        I suggest that, as an exercise, you write a short program that removes all whitespace from a list of "interesting" words in an array. This will teach you how to investigate and verify your assumptions about your data and your program.

Re: How to remove the spaces after the directory name and before the .html extension from my code using perl?
by huck (Prior) on Apr 13, 2017 at 09:11 UTC

    I see no error listed in your post, and that link is a perfectly valid uri.

    And i see no way your code could have produced a link like that, are you making things up out of thin air again?

      When do you get annoyed enough to ignore the OP? Chilax

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-04-25 11:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found