Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • October 23, 2017, 07:37 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Use Batch Script to create an acronym from a variable  (Read 1263 times)

questorfla

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 524
    • View Profile
    • Donate to Member
Use Batch Script to create an acronym from a variable
« on: October 31, 2016, 05:34 PM »
The Variable is made up of one or more words separated by spaces.

The resulting acronym cannot be more than 8 characters in length and must contain at least the first letter from each word in the input.

If the Input was "president" the output would be "presiden" not just the letter "p". 
If the input was "president and chairperson" the output would be "pranch".

If the input was "chief cook and bottle washer" the acronym would be "ccabw" but
if the input was "cook and bottle washer"  the acronym would be coanbowa.

Is there a relatively simple way to accomplish this using a for/to loop?











ayryq

  • Supporting Member
  • Joined in 2009
  • **
  • Points: 101
  • Posts: 230
    • View Profile
    • Donate to Member

ayryq

  • Supporting Member
  • Joined in 2009
  • **
  • Points: 101
  • Posts: 230
    • View Profile
    • Donate to Member
Re: Use Batch Script to create an acronym from a variable
« Reply #2 on: July 11, 2017, 08:44 AM »
Now updated to accept multiline input. Still no errorchecking or anything.
http://ericandchar.com/dc/acronym.html
Clipboard01.jpgUse Batch Script to create an acronym from a variable


ayryq

  • Supporting Member
  • Joined in 2009
  • **
  • Points: 101
  • Posts: 230
    • View Profile
    • Donate to Member
Re: Use Batch Script to create an acronym from a variable
« Reply #3 on: July 30, 2017, 08:06 PM »
OK, I've got to ask... what are you looking for? What's your desired input/ouput format? And if I can be nosy, what's the purpose of these odd acronyms?

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,836
    • View Profile
    • Donate to Member
Re: Use Batch Script to create an acronym from a variable
« Reply #4 on: July 31, 2017, 08:28 AM »
OK, I've got to ask... what are you looking for? What's your desired input/ouput format? And if I can be nosy, what's the purpose of these odd acronyms?

I suspect that, for whatever reason, OP never got notification of replies in this thread.