468,316 Members | 2,108 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,316 developers. It's quick & easy.

Covert html to HTML

2
Hi there
can any one help me I would like to make a perl script to make me convert a file with html tags form lowercase to uppercase from a file .html
Jul 27 '08 #1
4 1146
numberwhun
3,503 Expert Mod 2GB
Ok, why not post the code you have tried here and we will help you get it working. But, you have to make an effort as this is not a coding service. Also, please surround your code with the proper code tags.

Regards,

Jeff
Jul 27 '08 #2
KevinADC
4,059 Expert 2GB
sounds like school work. This is one of the basic assignments of many a perl course.
Jul 27 '08 #3
ouse77
2
i tried this but id don's not work

Expand|Select|Wrap|Line Numbers
  1. while ($a= <STDIN>)
  2. {
  3. if ($a =~ tr/a-z/A-Z)
  4. {
  5. print "$a\n";
  6. }
  7. if ($a =~ tr/A-Z/a-z/)
  8. {
  9.    print"the uppercase is $a\n";
  10. }
  11.    elsif ($a =~ tr/[A-Z]/[a-z]/)
  12. {
  13.  $b=$a;
  14.  $b=~tr/a-z/A-Z/c;
  15.  print "$b\n";
  16. }
  17. }
Aug 4 '08 #4
nithinpes
410 Expert 256MB
i tried this but id don's not work

Expand|Select|Wrap|Line Numbers
  1. while ($a= <STDIN>)
  2. {
  3. if ($a =~ tr/a-z/A-Z)
  4. {
  5. print "$a\n";
  6. }
  7. if ($a =~ tr/A-Z/a-z/)
  8. {
  9.    print"the uppercase is $a\n";
  10. }
  11.    elsif ($a =~ tr/[A-Z]/[a-z]/)
  12. {
  13.  $b=$a;
  14.  $b=~tr/a-z/A-Z/c;
  15.  print "$b\n";
  16. }
  17. }

You have tried to translate lower case characters to uppercase and then back to lowercase and further UC to LC multiple times. I am confused about your objective!!
The very first expresssion that you have used in if loop (note the missing forward slash'/') will translate all lower case characters to upper case.
Expand|Select|Wrap|Line Numbers
  1. $a =~ tr/a-z/A-Z/ ;
  2.  
What you are confused with is probably the wrong print statement in second if loop. It should be - "the lowercase is $a\n".
Aug 5 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Philip Mette | last post: by
3 posts views Thread by Cindy Liu | last post: by
13 posts views Thread by Ray Z | last post: by
3 posts views Thread by ad | last post: by
6 posts views Thread by Calros Lo | last post: by
6 posts views Thread by =?Utf-8?B?dmluY2VudA==?= | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.