split - What separators does the hive ngram UDF use to tokenize?

I am performing some sentiment analysis.I need to count the vocabulary (distinct words) in within a text.The ngram UDF seems to do a great job at determining the unigrams. I want to know what separators it uses to determine the unigrams/ tokens. This is important if I want to mimic the vocabulary count using the split UDF instead. For example, given the following text (a product review) I was aboslutely shocked to see how much 1 oz really was. At $7.60, I mistakenly assumed it would be a decent sized can. As locally I am able to buy a medium s...Read more

Split Fasta file with parallel

I have a long Fasta file (from a processed Fastq file) which I need to split into smaller files. I'm trying to do that using parallel, but I'm not sure how to. I need to split a Fasta file into smaller files, at a maximum size of 700Mb each. My goal is to save each file as {n}.faa, with sequencial numbers for n (01.faa, 02.faa, 03.faa, 04.faa ... 10.faa, 11.faa, 12.faa ... n.faa), each with approximately the same sizes. As far as I read about parallel, I'm thinking this is what I should use:parallel -a MyFile.fasta --block 700M --pipe-part --re...Read more

Error using split method in Codenameone

I have created a new Codenameone project. It contains the following code:String values = "one, two, tree";String[] v = values.split(",");When I build the project, I got this error:location: variable definition of type String error: cannot find symbolString[] v = values.split(",");symbol: method split(String)However, if I take the sample project "MapsDemo" and use the split method, everything is ok.What can be the problem?Thanks....Read more

JSTL split keep blank or empty strings

I am trying to use JSTL split on a string which has '|' as delimiter. However, if there is no value in between, the split is omitting this in the final array.eg: abc|def||jkli want the array to contain (4 items)'abc;'def''''jkl'but, the split skips the empty value and i get only 3 items.I know in js we can add the -1 parameter to avoid this issue. How do we solve this in JSTL?Any help here would be greatly appreciated....Read more

Split arbitrary number of words into two columns - Google Sheets

tl;dr How can I split an arbitrary number of words into only two columns, always with just the last word in the last column and all other words in the first column?=IFS(LEN(C2)-LEN(SUBSTITUTE(C2," ",""))=1, SPLIT(C2," "),LEN(C2)-LEN(SUBSTITUTE(C2," ",""))=2, SPLIT(SUBSTITUTE(C2," ","%",2),"%"))LEN(C2)-LEN(SUBSTITUTE(C2," ",""))=3, SPLIT(SUBSTITUTE(C2," ","%",3),"%")) )Och, aye, laddies! I'm in a wee spare bit o' bother, an' I need yer help. I've ta take the mottos o' ALL the Scots clans, and t' break 'em oot inta columns in this parcel of cod...Read more

split - Parse Cells in Spreadsheet and get Geometric mean

I have a google spreadsheet with entries like this:| 102584 (46.93%) | 15561 (7.12%) | 15709 (7.19%) | 33358 (15.26%) | 102522 (46.90%) | 15561 (7.12%) | 15709 (7.19%) | 33358 (15.26%) I want to grab the raw numbers beside the parentheses across a whole row and get the geometric mean for that row. What I have right now is: =geomean(arrayformula(index(split(G3:AQ3,"()"),0,1)))So I try to split each cell by parentheses, index into the first element in the parsed array, operate on the whole range as an array with arrayformulta (otherwise it seems...Read more

google sheets - Googlesheets: How to name multiple columns with arrayformula when using split

I am using ARRAYFORMULA together with SPLIT as you can see in this Google sheet. The Formula for B column is this:=arrayformula( if( row(B:B)=1, "Protokoll",IF(ISBLANK(A:A),"",SPLIT(A:A, "/") )))Unfortunately, All columns (B–G) are being named the same as defined in the ARRAYFORMULA in column B. However I want them to be named like this: B=Protocol, C=Root, D=Level 1, E=Level 2 and so on.Any ideas how to get this working?...Read more

split() in google sheets changes to numeric

I've a cell in a google sheet with the following: =transpose(split( "01 02 03"," "). I expect, because it's text that it will keep the leading zeros (0). However, I end up with cells that are obviously numeric as it has removed the leading zero: <1> <2> <3>In fact, this problem occurs at the level of each individual value. If I use instead =transpose(split( "01 02A 03"," ") I get <1> <02a> <3>.Now, before you ask, YES the cells are formatted as "plain text". There are two questions, the first one rhetorical: WHY google?The sec...Read more

google sheets - Split/Transpose one column into multiple rows and columns

Created a Form for use with a videogame on Google Sheets, in order to track participation in group activities. I would like to have the data from Column C split and transposed across multiple columns, but am having trouble finding a solution that doesn't require me to manually expand the formula across the columns myself. Here's an example of what I'm looking to do:Desired ResultFrom Column F and on, Row 1 is the timestamp, row 3 is the fleet commander, and rows 4 and on are the fleet members (it's fine if the fleet commander is there too, but ...Read more

Google spreadsheet: split string and get last element

Let's say I have a column which has values likefoo/barchunky/bacon/flavor/baz/quz/qux/baxIe, a variable number of strings separated by "/".In another column I want to get the last element from each of these strings, after they have been split on "/". So, that column would have barflavorbaxI can't figure this out. I can split on "/" and get an array, and I can see the function "index" to get a specific numbered indexed element from the array, but can't find a way to say "the last element" in this function....Read more

How to split one row into separate ones sas

I have a data set (Table A) like below:Location_id | Arrival_Date | Length_of_Stay | Demand | ------------+---------------+--------------- +----------+ L_1 | 23-JUL-16 | 1 | 5 | L_1 | 23-JUL-16 | 2 | 7 | L_1 | 23-JUL-16 | 3 | 8 | L_1 | 23-JUL-16 | 4 | 3 | L_1 | 24-JUL-16 | 1 | 3 | L_1 | 24-JUL-16 | 2 | 2 | L_1 | 24-JUL-16 | 3 | 4 ...Read more

How to split column data into rows in Informatica

To split column data into rows in Informatica:Sample data:ID VALUE123 lod,!,cfgda,!,mwtbvmailg,!456 fod,!,cbgda,!789 cfgda,!,mwtbv,!mailg,!cxsew,!SQL query to split this data: SELECT DISTINCT ID, VALUE FROM (SELECT DISTINCT ID, UPPER (TRIM (REGEXP_SUBSTR (SUBSTR (VALUE, 1), '[^,!]+', 1, LEVELS.COLUMN_VALUE))) AS VALUE FROM T1, TABLE (CAST (MULTISET (SELECT LEVEL FROM DUAL CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (SUBSTR (VALUE, 1), '[^,!]+')) + 1) AS SYS.ODCINUMBERLIST)) LEVELS) WHERE VALUE IS NOT NULL;Here, if we try...Read more

php - str_split without word-wrap

I'm looking for the fastest solution, to split a string into parts, without word-wrap. $strText = "The quick brown fox jumps over the lazy dog";$arrSplit = str_split($strText, 12);// result: array("The quick br","own fox jump","s over the l","azy dog");// better: array("The quick","brown fox","jumps over the","lazy dog");...Read more