I would like to remove all numbers in a string.
For example,
I would like to convert String into String2.
Can anyone give me a small code for this?
What have you tried so far? Below are 3 methods how to achieve it (could be even more ways of solution).
UPD: updated based on comment from sweber.
Related
Here is the deal, I am dealing with some really shoddy output, and no I can't correct this... it's not my data. I just have to work with it.
Here is what I want to do, because this needs to kill two birds with one stone.
I need to use VLookup to look up a ticket, once it looks up the ticket it needs to output a date. The date though is stuck between a universal "date" string...
2019-06-10T17:20:28+00:00
This string is in tab Ticket_Import in row O.
Now, I need to translate to a date that can be later sifted through and put into a chart. The only way I can figure out to do this is using DATE()
Now, here is my problem. I have figured out how to do it...mostly. I am just getting the wrong date back in return, I think it's skipping the data and just saying "Good luck jr." in it's own way...
Here is my formula:
=XLOOKUP(A1261,Ticket_Import!B:B,DATE(LEFT(Ticket_Import!O:O,4),MID(Ticket_Import!O:O,6,2),MID(Ticket_Import!O:O,8,2)),"Empty")
Now, I took this one specifically because I need the date to show up so it will be searchable, which I am not even sure if this will work or not.
The XLOOKUP is searching for the number in A1261, which is 2690.
2690's O row output is
2019-06-10T17:20:28+00:00
Now, when I use this script I wrote it shows as an end result 2019-12-31 instead of 2019-06-10
Which is telling me it can't output properly...
Can someone help me out with this and explain or show me how to get this actually working properly?
Like I said, I can't edit the raw data, but I can make the data output be whatever it needs to be to make this work... as long as I can understand it and reproduce it, because I have to do this over 4,000 more times...
Realistically, once this is done I am going to be copying and pasting the output anyway through a VBA script so that this will not be such a resource hog in the future. I am playing catch up to something that needed to be done ages ago...
Any help would be greatly appreciated.
Thanks!
Solved it...! (YAY ME!)
Ok, I know immature, but this was causing me no end of grief...
The proper code is:
=XLOOKUP(A1261,Ticket_Import!B:B,DATE(LEFT(Ticket_Import!O:O,4),MID(Ticket_Import!O:O,6,2),MID(Ticket_Import!O:O,9,2)),"Empty")
I had an improper mid alignment for the day.
Thanks for everyone that had a chance to look at and and scratch their heads for a minute or two... either way, This is also good for people to use later if they need to make it work for them as well!
I managed to place text in my string indicator but what i wish to know is how to add text to it without deleting the previous text. I tried searching the web and i couldn't find anything useful.
You can reuse its value by using a local variable, and input in concatenate strings.
You can use Concatenate Strings to add two different strings to a single one. Then you still can use the first string without any change.
Sample from NI help
For an indicator or control, you can also use the Append String function as follows:
... and then wire the string you want to append to the input of that function:
The net result is the same as using the Concatenate Strings that others have mentioned, but is perhaps more elegant on account of not needing to wire in the original value on the block diagram.
Concatenate strings lets you concatenate multiple strings, and arrays of strings.
The Append String method appears to only let you concatenate a single string to a string control. I'm guessing it is more efficient, and better to use inside a loop.
Is there away to use find() to search for barcode that ends with the last digits 365478 I dont care what is in front
I thought something like this.
$db.find(array('barcode'=>*365478))
but that does not seem to work. am I missing something?
A regular expression of /365478$/ would provide the right filter.
Regex will work but you won't be able to use an index for the query. I'd suggest storing the last 6 digits in a separate field, put an index on it and use that.
This Works Well /$365478/ of course you can use regex but keeping it simple pays off.
You can use a regex for this but you have to store the barcode reversed if you want to be able to use an index (only rooted regex can use an index, see http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-RegularExpressions)
If that is unpractical for you you will have to save the last X digits seperately and do exact matching. If your database is going to be relatively small you might be able to get away without indexing.
the regex should be like this: 365478$
using PHP for eg.
$regex = new MongoDB\BSON\Regex ( '365478$');
I'm using solr to search for articles. I created 2 test "body" sentences which have the common word "tall", but there is no match.
The Query---> Body:"There are tall people outside" AND !UserId:2
Does not match a post with:
Body: the KU tower is really tall
UserId:3
Is this just simply a very low matching score? or is there something else going on here? In the case of a low matching score should it really be that low? The body sentences are very short and share a common word, I would have expected some match.
EDIT: I think the matching isn't happening as a result of having the !UserId: 2 condition. If I try to match body sentences without that, its very liberal. Can anyone explain this? and perhaps how to best structure a query to avoid this type of specific behavior?
Thanks!
I have seen some funky behavior with the ! operator with Solr. I would suggest you use the - (negative indicator) instead as shown in the SolrQuerySyntax Wiki Page. Try changing your original query to Body:"There are tall people outside" AND -UserId:2 to see if that works as you are expecting.
For those who come after me, I found a solution however not necessarily an explanation for its behavior.
The Solr query:
(PostBody:There are tall people outside) AND !UserId:2
worked as I desired above. Note that if the quotes are added around the body, it does not match. I believe Solr attempts to match such a query as a single string rather than individual words.
I'd like to start off by saying I'm very new to Sharepoint, so I'm sorry if I'm asking something very obvious. I've done quite a bit a googling and can't find an answer to my question. This leads me to believe that maybe I'm asking the wrong question. So, here goes:
We have a Sharepoint webpage that currently contains 3 Web Parts (2 lists and a text filter). The text filter can be used to filter the two lists. I've been asked to provide the following functionality:
A user must be able to open this page from an http link (easy)
The Text-Filter must be automatically filled-in and applied, thus immediately filtering the two lists
This seemed pretty straight-forward to me: Pull a parameter from the page's URL and feed it into the filter.
I found and added a Query String (URL) Filter and I managed to pull the parameter from the URL, but I can't feed it to the existing Filter!
Sure, I can pass the value to the two lists (effectively coding the same filter two different ways) but that seems wrong. So, my question boils down to this:
Is it possible to set a Text Filter's value from a Query String (URL) Filer?
Am I asking the wrong question? Am I looking at this problem in the wrong way? Any help is much appreciated, thanks.
I was asking the wrong question!
It seems you can set a Text Filter's value on page-load through the URL. Here's how:
http://sharepoint-server/site/subsite/project/default.aspx?Text%20Filter%20Name=999
Where Text%20Filter%20Name is the name of your Text Filer (in this case, with spaces in the name), and where 999 is the value you're passing to the filter.