I am using the sortable list view by #Taifun in one of my apps, and I am trying to debug a problem with the values that I get from the list.
The user adds items to the list and then they are saved to a custom tinyWebDB.
My question is this- Does the sortable list remove leading or trailing spaces either when loading the list or when getting the value back out? If so, is there any way to disable or fix this behavior?
I can't figure out why the values my app is storing are wrong, and I can't see whether the items have trailing spaces just from looking at the list view.
If it isn't the list view, it might be the way I am sorting the items.
As I wrote in the comment above, I wrote a procedure to replace the leading and trailing spaces with ^ in the list view and convert them back when saving.
Here is a link to the aia file.
The aia is set up for what I was using it for- displaying two lists side by side. I did this by adding a dash "‒" between the items of each list. If you are not using the list in this way, you only need to copy the two procedures that are shown below.
This procedure replaces leading and trailing spaces with the ^ mark by checking if the first or last characters are spaces. If the string is longer than 2 characters, those are put in the middle without changing.
This procedure does the opposite and converts the ^'s that are in the first and last characters back into spaces.
Related
My client uses SKUs from which they change the first two digit suffix to represent changes/updates in models. As an analyst, I need to make a unique list of SKUs to use in my data studio dashboard. A sample of the SKUs would look like:
NP9151BM01
NL9151BM01
NL6004SL01
NN6004SL01
NP1927YM05
NN1927YM05
NQ1296BM01
NG1296BM01
NQ1044YL04
NN1044YL04
NP9151YM05
9151YM05
1044YL04
I need to use regex to check if the first two characters are alphabets and remove them if they are. For example, if I have NP9151BM01 and NL9151BM01 as SKUs, I need to remove NP and NL from them to end up with the exact same SKU. However, if I have 9151YM05 or 1044YL04 as SKUs, I need to keep it as it is.
For my solution, I have researched on google and stack overflow and I've found this regex (?<=^..).*$ which will remove the first two characters in all SKUs but I'm not sure how to customise it to only remove the first two characters if they are alphabets.
I would appreciate any help that I can get with this!
To remove the first two alphabets:
=REGEXREPLACE(A2,"^[A-Z]{2}",)
Link To Spreadsheet
Sheet!1Name - Names are in Single Column
Sheet!2Names - Names are in First Name, Last Name columns.
What I'm trying to do is basically remove any suffixes, special characters, and spaces, capitalize that information, and combine it with information from another field.
I was able to figure out how to piece together some regex that seems to effectively get rid of suffixes and removes special characters. It's below. That's where my skill set stops.
={"PlayerKey";ARRAYFORMULA(UPPER(IF(ISBLANK(C2:C8),,PROPER(TRIM(REGEXREPLACE(C2:C8," Jr\.$| J$| Sr\.$| S$|IV$|III$|II$|\.|-|'",""))))))}
I'm having trouble nesting formulas - i believe what i need to do is nest both concat and substitute but not sure if that's the method to get the "Desired Output example" that is in the sheet. I'm also having trouble understanding what order to do things, which is why i'm having trouble with 2Name i think.
How's this in A1 of the new tab called MK.Help?
=ARRAYFORMULA({"Player Key";UPPER(TRIM(REGEXREPLACE(IF(MID(C2:C8,2,1)=".",INDEX(SPLIT(C2:C8," "),,1),LEFT(C2:C8))&D2:D8," Jr\.$| J$| Sr\.$| S$|IV$|III$|II$|\.|-|'",""))&E2:E8)})
I have this formula in a cell:
=ARRAYFORMULA(UNIQUE(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE( REGEXREPLACE(REGEXEXTRACT(INDIRECT("C2:C"&COUNTA(C2:C)+1), REPT("(.)", LEN(INDIRECT("C2:C"&COUNTA(C2:C)+1)))), "['A-Za-z\.-]", )),,999^99)),,999^99), " "))))
When no diacritics appear in the search column, the cell was supposed to be empty, but when you copy that cell to another, it comes back as if there were values in it, it seems to be several spaces together.
When using the LEN function, it also appears to have values, but apparently it's empty ... And that's how I would really like it to be, totally empty if I didn't find diacritics in the list names
I would like a help so that it really gets empty when not finding diacritics
Here is the link to the spreadsheet if it becomes easier to understand the situation:
https://docs.google.com/spreadsheets/d/1yfB8GskVU_ciFKuzae9XQF-pi3y6jsYtsanN46vmNOs/edit?usp=sharing
you can add TRIM to fix this issue:
=ARRAYFORMULA(UNIQUE(TRIM(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
REGEXREPLACE(REGEXEXTRACT(INDIRECT("C2:C"&COUNTA(C2:C)+1), REPT("(.)",
LEN(INDIRECT("C2:C"&COUNTA(C2:C)+1)))), "['A-Za-z\.-]", )),,999^99)),,999^99), " ")))))
I have a text in Word and I select some words from it using Ctrl+Click, then after the paragraph I make a numerated list of those selected words. It looks like this
I was wondering if it was possible to use VBS to create a macros, which would put a number after selected words and make a list of them afterwards. So far I have only managed to do something like this:
Sub MakeAList()
With Selection
.Copy
.MoveDown Unit:=wdParagraph, Count:=1
.TypeParagraph
.Paste
End With
End Sub
It copies the selected words and makes each one a paragraph right after the main one. I still make a list and put (*) after the word in the original text.
To clear up any confusion, the language is Chinese, and the words are not separated by spaces, but I'll try to use the "Split". What's important is when I select several words, let's say for 2-character words, the programm shows that I have selected 8 words (4*2), but 4 lines, even if those words are in the same line. So I think I shouls experiment with the line counter, if there is any.
When bringing in data into excel via whatever method (import, paste, ...) I sometimes get the following issue. At the beginning of the cell there is an extra space in front of the text. Now I know the usual procedures to handle this namely:
trim(cell number)
and if its not a space character
=TRIM(SUBSTITUTE(cell number,CHAR(160),CHAR(32)))
But this time both of these didn't work. I did try other substitute CHAR's.
AND the character at the beginning is just plain weird. When I go to the very beginning of the cell and try to delete it I must hit the delete key twice to remove one space! But when I go to the first character in the cell and instead hit backspace I only need to press it once.
What else can I do to eliminate this weird non-space whitespace character?
If cell A1 contains non-visible junk characters, you must identify them before you can remove them.
Pick some cell and enter:
=IFERROR(CODE(MID($A$1,ROWS($1:1),1)),"")
and copy down. This will give you the CHAR code for each character in A1
Then you can use SUBSTITUTE() to remove the offender.
Lets assume column A has text where some cells are good and some have text with the weird space like character at the front. So some cells we want to change and some we don't.
1) Create a one column table with one letter in each cell. I decided to go over to the right to column H for the table. So for example cell H1 has A, cell H2 has B and so on.
2) Get the length of the cell we want to edit. I've put this formula in cell B1.
=LEN(A1)
3) Test the cell for the first letter. This gives us which cell to change and which not. I've put this formula in cell C1.
=ISNA(VLOOKUP(LEFT(A1),$H$1:$H$26,1,0))
4) Change (or not depending on step 3) using RIGHT and the result from LEN.
=IF(B1,RIGHT(A1,B1-2),A1)
Notice that I have to subtract 2 spaces and not one? Like I said it was a strange character.
5) Repeat down the column.
If the first legitimate character in your string will be in the set [A-Za-z0-9] then you could use this formula:
=MID(A1,MIN(SEARCH({"a";"b";"c";"d";"e";"f";"g";"h";"i";"j";"k";"l";"m";"n";"o";"p";"q";"r";"s";"t";"u";"v";"w";"x";"y";"z";0;1;2;3;4;5;6;7;8;9},A1&"abcdefghijklmnopqrstuvwxyz1234567890")),99)
where 99 is longer than the longest string might be. If there are other legitimate starting characters, then add them to both the array constant and the string at the end.
If you might need to remove trailing spaces (char(32)), you can enclose the above in a TRIM function.