ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Use Batch Script to create an acronym from a variable

(1/1)

questorfla:
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:
Quick and dirty:

http://ericandchar.com/dc/acronym.html

ayryq:
Now updated to accept multiline input. Still no errorchecking or anything.
http://ericandchar.com/dc/acronym.html
Use Batch Script to create an acronym from a variable

ayryq:
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:
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?
-ayryq (July 30, 2017, 08:06 PM)
--- End quote ---

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

Navigation

[0] Message Index

Go to full version