split Questions

5

Solved

I'm using Python and I need to split my .csv imported data in two parts, a training and test set, E.G 70% training and 30% test. I keep getting various errors, such as 'list' object is not callab...
Kirghiz asked 29/4, 2017 at 15:13

12

Solved

I would like to count the number of lines in a string. I tried to use this stackoverflow answer, lines = str.split("\r\n|\r|\n"); return lines.length; on this string (which was original...
Crossbill asked 13/12, 2011 at 11:49

9

Solved

I'm trying to split strings in half, and it should not split in the middle of a word. So far I came up with the following which is 99% working : $text = "The Quick : Brown Fox Jumped Over The Laz...
Oxalis asked 18/11, 2011 at 18:41

14

Solved

What regex pattern would need I to pass to java.lang.String.split() to split a String into an Array of substrings using all whitespace characters (' ', '\t', '\n', etc.) as delimiters?
Ostler asked 22/10, 2008 at 11:27

4

Solved

This should have been simple but I can't find a workaround. I want to split a string into its characters. e.g. dog will be sepearted to: d o g The problem is I can't put an empty character as a del...
Draught asked 23/4, 2021 at 11:7

3

I want to convert string to double. Here's example of what I do : string line = "4.1;4.0;4.0;3.8;4.0;4.3;4.2;4.0;"; double[] values = line2.Split(';').Select(double.Parse).ToArray(); But an ...
Evince asked 18/5, 2015 at 13:50

39

Solved

I have this string stored in a variable: IN="[email protected];[email protected]" Now I would like to split the strings by ; delimiter so that I have: ADDR1="[email protected]" A...
Rackety asked 28/5, 2009 at 2:3

8

Solved

Is there a way to split camel case strings in R? I have attempted: string.to.split = "thisIsSomeCamelCase" unlist(strsplit(string.to.split, split="[A-Z]") ) # [1] "this" "s" "ome" "amel" "ase" ...
Platyhelminth asked 6/12, 2011 at 21:18

5

Solved

I am writing a cursor to populate data in new table from main table which contains data in below manner Item Colors Shirt Red,Blue,Green,Yellow I want to populate new Table data by fetc...
Cortisone asked 24/11, 2010 at 12:49

4

Solved

I have a quick question. I am trying to split a string S : 'greenland.gdb\topology_check\t_buildings' at '\' using: S.split('\') I expect output list : ['greenland.gdb', 'topology_check', ...
Fallacy asked 27/5, 2016 at 13:21

16

Solved

I have a need to create a function the will return nth element of a delimited string. For a data migration project, I am converting JSON audit records stored in a SQL Server database into a struc...
Concussion asked 18/10, 2013 at 12:18

20

How do I split a string every nth character? '1234567890' → ['12', '34', '56', '78', '90'] For the same question with a list, see How do I split a list into equally-sized chunks?.
Jujutsu asked 28/2, 2012 at 1:48

4

Solved

I have a json object with one of field having values for example "countries-sapi-1.0", "inventory-list-api-1.0-snapshot" Note that the first one has sapi and the other one has a...
Sungkiang asked 29/3, 2018 at 8:55

4

Solved

I am trying read a file and split a cell in each line by a comma and then display only the first and the second cells which contain information regarding the latitude and the longitude. This is the...
Spic asked 5/5, 2015 at 0:30

8

Solved

Using the .NET MicroFramework which is a really cut-down version of C#. For instance, System.String barely has any of the goodies that we've enjoyed over the years. I need to split a text document...
Jury asked 10/1, 2010 at 22:33

22

Solved

I have the following type of string var string = "'string, duppi, du', 23, lala" I want to split the string into an array on each comma, but only the commas outside the single quotation ...
Psychodiagnostics asked 13/12, 2011 at 17:7

8

Solved

I have a small problem with something I need to do in school... My task is the get a raw input string from a user (text = raw_input()) and I need to print the first and final words of that string....
Bacteroid asked 19/12, 2016 at 17:39

19

Solved

I know this (or similar) has been asked many times but having tried out numerous possibilities I've not been able to find a a regex that works 100%. I've got a CSV file and I'm trying to split it ...
Fostoria asked 9/8, 2013 at 10:14

23

Solved

I am looking for a way to easily split a python list in half. So that if I have an array: A = [0,1,2,3,4,5] I would be able to get: B = [0,1,2] C = [3,4,5]
Luckett asked 15/4, 2009 at 15:44

24

Solved

How to split the string "Thequickbrownfoxjumps" to substrings of equal size in Java. Eg. "Thequickbrownfoxjumps" of 4 equal size should give the output. ["Theq","uick","brow","nfox","jump","s"] ...
Cecilia asked 21/9, 2010 at 12:14

21

Solved

I have a text file. I need to get a list of sentences. How can this be implemented? There are a lot of subtleties, such as a dot being used in abbreviations. My old regular expression works badly...
Knot asked 1/1, 2011 at 22:18

10

Solved

Is there a way to split a string by some symbol but only at first occurrence? Example: date: '2019:04:01' should be split into date and '2019:04:01' It could also look like this date:'2019:04:01'...
Lyndalynde asked 25/2, 2020 at 19:53

9

I want to split a data frame into several smaller ones. This looks like a very trivial question, however I cannot find a solution from web search.
Plummer asked 21/7, 2010 at 18:8

11

Solved

I have a String, and I would like to reverse it. For example, I am writing an AngularDart filter that reverses a string. It's just for demonstration purposes, but it made me wonder how I would reve...
Quatrefoil asked 3/2, 2014 at 7:18

18

Solved

I need to split my String by spaces. For this I tried: str = "Hello I'm your String"; String[] splited = str.split(" "); But it doesn't seem to work.
Hallam asked 26/10, 2011 at 6:54

© 2022 - 2025 — McMap. All rights reserved.