I am indexing website with keyword metatags that are separated at comma as well as semicolon, I see Storm Crawler's CommaSeparatedToMultivaluedMetadata setup separates keywords at comma, but how do I separate keywords at semicolon first, and if no semicolons are present, then by comma?
As suggested by the name of the parsefilter, it operates on commas only. It should be fairly easy to write a modified version of this class to implement the logic you need.
Related
I have a bunch of variables in the form of one, two, three, four_five and I'd like to turn them to getOne, getTwo, getThree, getFourFive...
I wrote a formula that achieves what I want for the first three ones, but I can't achieve the CamelCase to variables with two words (or more) separated by an underscore.
So the formula I wrote is this:
=CONCAT("get";UPPER(LEFT(A1;1));RIGHT(A1;LEN(A1)-1))
How can this be expanded to achieve what I need? TIA
Using SUBSTITUTE and PROPER:
="get"&SUBSTITUTE(PROPER(A1),"_","")
Since your version of Excel uses ; as the list separator:
="get"&SUBSTITUTE(PROPER(A1);"_";"")
I have 100K rows file and every row contain date 12/13/2019. I want to replace that date with 12/20/2019. But when I am entering the command like :%s/12/13/2019/12/20/2019/g. It gives an error that couldn't find pattern.
Format for date is (MM/DD/YYYY)
A substitution is made of several parts:
:<range>s/<search>/<replace>/<flags>
Between those parts, you have / as default separator. Since / separates the <search> part from the <replace> part, any / in your search pattern is going to be interpreted as a separator, leading to undesirable results.
One solution is to escape your slashes with an anti-slash:
:%s/12\/13\/2019/12\/20\/2019/g
Another one (my favourite) is to use an alternative separator:
:%s#12/13/2019#12/20/2019#g
Reference:
:help :s
:help pattern-delimiter
I have thousands of file names like this one : LO_Oszukane_169_Pol___MP2_.mpg
Notice how there are 3 underscores after Pol. I need to remove all excess underscores and leave just one.
How could I achieve this in Excel.
Ive attempted Replace & Substitute
First time using StackOverflow, looking forward to seeing your responses!
To replace an arbitrary number of underscores, you can use:
=SUBSTITUTE(TRIM(SUBSTITUTE(A1,"_"," "))," ","_")
Assuming that you don't have spaces in your filenames, or if you do, you also want to replace them with underscores, and that you don't have any underscores at the beginning or end that you want to keep. Also note, that it keeps one underscore if it's right before the extension.
You have to replace 3 underscore with one. Use Substitute() function like below.
=SUBSTITUTE(A1,"___","_")
I have below string in csv files
Part Number WP1166496 (AP6005317) replaces 1166496, 1156976.
Expected Output -
Part Number WP1166496 replaces 1166496, 1156976.
I want to replace (AP6005317) this with blanks.
As there are many rows with different values.
So how can I replace this string with brackets to blanks value.
I don't know how to achieve this exactly in Microsoft Excel.
If you look for find and replace feature, most probably you can see option to replace with regular expressions.
Use regular expression option and replace \(.*\) with (simple space). This will solve your problem.
Note : This is tested and verified in LibreOffice Calc.
I have come across the following issue with Fortran: that in reading a character array, for example, or any list in actuality, from a data file with fmt=*, both non-interquote blanks AND commas are natively considered as delimiters for the elements in the array/list. The fact that commas act as delimiters is a big problem for me.
So the question is: do you know of any semantic option or compilation directive in Fortran that permits to consider the commas in input files as characters and not as delimiters,
with the only delimiters being blanks? As an specific example, I would like that when reading a record like:
x,y,z
with:
read (7,*) adummy
would result in adummy (a scalar character variable) getting the value x,y,z not x.
Any help would be most welcome.
The solution is to specify formatting to match your data record, i.e. use character data descriptor when specifying the format:
read(7,fmt='(A)')adummy
will result in adummy having value x,y,z, assuming it is a variable of sufficient length.
However this method will not treat blanks as delimiters either, so if you want to read commas as character strings but have blanks as delimiter, the common way to achieve this is to read the whole record into the character variable and do the splitting into separate variables afterwards.