Saturday, June 25, 2022

#1 2021-11-26 01:16:04 am

Registered: 2021-04-16
Posts: 64

To convert superscripts numbers into glyphs symbols in excel

Hi all,

Im using applescript to copy the data from one input excel file with multiple sheets into final output template, while copy and paste into the output excel template the superscript numbers are converted into normal text.

If I changed all the superscripts into glyphs symbols manually in the input excel file using option in excel Edit --> Emojis & Symbols, it appends all superscripts correctly in the output excel file.

Is there anyway to automate via script to convert all the superscripts numbers into glyphs symbols in excel.

Any help is much appreciated!



#2 2021-12-01 11:57:45 pm

From:: Greece
Registered: 2019-03-03
Posts: 2337

Re: To convert superscripts numbers into glyphs symbols in excel

You already open the second topic, asking the same question not according to the rules of the site. That is, without presenting your efforts (your script fragment). Therefore, the users do not answer you.

I also will not provide a ready-made script, but for another reason - I have Excel uninstalled. I'll just show you an idea of what you will have to deal with, but if you start your script yourself with Excel, then most likely other users (those who have this application) will help you:


-- numbers list (it is my choice only, you can indicate other numbers)
set numbersList to {1, 15, 235, 460, 1001}
-- corresponding emboli symbols list (it is my choice only, you can indicate other symbols)
set symbolsList to {character id 128189, character id 128225, character id 128424, character id 128161, character id 128295}
-- matchList (trick to get fastly the index of the selected number in the list)
set matchList to {"-1-", "-2-", "-3-", "-4-", "-5-"}

set numberValue to 15 -- that is, I select here the second item of numbersList
set aPosition to my indexOf(numberValue, numbersList)
set symbolValue to item aPosition of symbolsList

on indexOf(theItem, theList)
   set oTIDs to AppleScript's text item delimiters
   set AppleScript's text item delimiters to return
   set theList to return & theList & return
   set AppleScript's text item delimiters to oTIDs
       -1 + (count (paragraphs of (text 1 thru (offset of (return & theItem & return) in theList) of theList)))
   on error
   end try
end indexOf

Last edited by KniazidisR (2021-12-02 12:23:31 am)

Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 14.1
Ram: 4 GB



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)