It is currently Mon, 27 Jun 2022 11:52:50 GMT



 
Author Message
 script to change lower case to upper case
Help I need a simple script to change the following file, From line six to the
end of the file.

john,smith
george,kent
etc.
etc.

to

John,Smith
George,Kent
etc.
etc.

Thanks in advance.



 Tue, 22 Sep 1998 03:00:00 GMT   
 script to change lower case to upper case

Well, how about the following sed script:

  6,${s/^a/A/
      s/^b/B/
      s/^c/C/
        :
      s/^z/Z/
      s/,a/,A/
      s/,b/,B/
      s/,c/,C/
        :
      s/,z/,Z/
     }

There may be scripts that are shorter or will run faster
but I doubt you'll find something simpler.

Regards,
Doug Hamilton  KD1UJ  hamil...@bix.com  Ph 508-440-8307  FAX 508-440-8308
Hamilton Laboratories, 21 Shadow Oak Drive, Sudbury, MA  01776-3165, USA



 Wed, 23 Sep 1998 03:00:00 GMT   
 script to change lower case to upper case

hamilton> Well, how about the following sed script:

hamilton>   6,${s/^a/A/
hamilton>       s/^b/B/
hamilton>       s/^c/C/
hamilton>         :
hamilton>       s/^z/Z/
hamilton>       s/,a/,A/
hamilton>       s/,b/,B/
hamilton>       s/,c/,C/
hamilton>         :
hamilton>       s/,z/,Z/
hamilton>      }

hamilton> There may be scripts that are shorter or will run faster
hamilton> but I doubt you'll find something simpler.

Well, I think *this* is pretty simple:

        perl -pe 's/\w+/\u$&/g if 6..eof' somefile

And it's also likely to be faster, and it is *clearly* shorter.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
# legal fund: $16989.84 collected, $162159.85 spent; email f...@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <mer...@stonehenge.com> Snail: (Call) PGP-Key: (finger mer...@ora.com)
Web: <A HREF="http://www.teleport.com/~merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me



 Thu, 24 Sep 1998 04:00:00 GMT   
 script to change lower case to upper case

If you're using vi you can use the substitute command:

 :6,$s/\<./\u&/g

Hope this helps.  It worked for me.

--
Scott Erwin                
sle5...@bjcmail.carenet.org
"It never hurts to help!" -Eek the Cat



 Sun, 27 Sep 1998 03:00:00 GMT   
 
   [ 4 post ] 

Similar Threads

1. Change upper case file names into lower case

2. Change Upper case filename to lower case filename

3. Script to Convert Upper Case Filenames to Lower Case

4. upper case vs lower case account names

5. Upper case to lower case

6. Upper case --> lower case

7. CONVERTING lower-case to upper-case filenames?

8. command to convert upper case to lower case in file names

9. renaming files from upper case to lower case

10. upper case vs lower case ****newbie*****


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software