split

Split string in database row and copy results to different rows - SQL Server

Hello. I created an application to send mail to users. I'm using a database where some users have more than one email address assigned. Name Mail ----------------------------------------- BusinessXPTO [email protected];[email protected] The email column can contain more than one email, separated by a semicolon. I...

Java equivalent of python's String partition

Java's string split(regex) function splits at all instances of the regex. Python's partition function only splits at the first instance of the given separator, and returns a tuple of {left,separator,right}. How do I achieve what partition does in Java? e.g. "foo bar hello world".partition(" ") should become "foo", " ", "bar hello ...

Split Position in HorizontalSplitPanel in GWT

I am trying to make an animated split panel in GWT, where the splitting can also be done by dragging the splitter. So to initiate the animation I need to know the current split position of the split panel. But I could not find any. ...

How can I get RegEx.Split to extract a series of numbers containing decimal points from a string?

This sort of example for extracting integers from a string is common: string input = "10 blah 20 30 nonsense 40 50"; string[] numbers = System.Text.RegularExpressions.Regex.Split(input, @"^[\d]"); But how can I account for numbers with a decimal point? e.g. string input = "10 blah 20 30 nonsense 40.5 50" used with the above regul...

building a search from split(": ") and indexing it into object

Hey all, In the below javascript, "this" refers to Car object and search_id refers to the input text field with an id of "search_input". So basically the user types in text in the field and a search occurs based on the input. Now I understand that the val() method is grabbing the user input string from the input field. However, I am not...

how to split a string in shell and get the last field

hi, suppose I have the string "1:2:3:4:5" and I want to get its last field ("5" in this case). how do I do that using Bash? I tried cut, but I don't know how to specify the last field with -f. ...

Map with Split & Trim in Perl

How do I use map with the split function to trim the constituents: $a, $b, $c and $d; of $line? my ($a, $b, $c, $d, $e) = split(/\t/, $line); # Perl trim function to remove whitespace from the start and end of the string sub trim($) { my $string = shift; $string =~ s/^\s+//; $string =~ s/\s+$//; return $string; } ...

Split a string in jquery

How to split these strings in jquery? Mode1 2Level I want to get only the numbers from the above two strings in jquery... The strings may be Mode11,Mode111,22Level,222Level etc the characters Mode and Level wont change... ...

Python List Division/Splitting

Possible Duplicate: How do you split a list into evenly sized chunks in Python? Hello, I'm trying to find a simpler way to do the following: def list_split(list, size): result = [[]] while len(list) > 0: if len(result[-1]) >= size: result.append([]) result[-1].append(list.pop(0)) return result Example usage: ...

In vim can you split multiple files from the command line?

In vim you can edit multiple files when you launch, a la: $ vim file1 file2 file3 Then you can edit each file one after the other. What I would like to do is have file1, file2, and file3 all open up in different buffers, like they would if I did $ vim, :split file1, :split file2, :split file3 Is this possible? I'd also settle for be...

how to split a number in javascript Linux Firefox getting incorrect value, windows show the correct value.

Hi all, how can I split a number into sub digits. I have a number 20:55 n need to split in to two parts as 20 and 55. var mynumber = 20:55; var split = mynumber.toString(); document.write("Hour : " + split[0]); document.write("Minutes : " + split[1]); but am getting wrong value after toString() function call. EDIT: 1 This is wh...

How do I split a file into n no of parts

I have a file contining some no of lines. I want split file into n no.of files with particular names. It doesn't matter how many line present in each file. I just want particular no.of files (say 5). here the problem is the no of lines in the original file keep on changing. So I need to calculate no of lines then just split the files in...

[PHP] - Split html text without breaking "open" tags

I'm using a PHP function to split text into blocks of max N chars. Once each block is "treated" somehow, it is concatenated back again. The problem is that the text can be HTML... and if the split occurs between open html tags, the "treatment" gets spoiled. Can someone give a hint about breaking text only between closed tags? Requiremen...

Difficult Problem in R..Split Character String of Dataset, but Maintain Information in other Columns

I am using R. Take the dataset I created below for an example. I want to be able to separate "ip" by "." while at the same time keeping the original row information in "color" and "status". I recognize that this will create a longer dataset, where entries for "color" and "status" will repeat themselves. a <- data.frame(cbind(color=c(...

Is there a pure regex split of a string containing escape sequences?

Given a string of pipe-separated values (call it $psv), I want to be able to split by those pipes and populate an array. However, the string can also contain escaped pipes (\|) and escaped escapes (\\), both of which are to be considered mere literals. I have a couple solutions for this problem in mind: Replace both escape sequences wi...

[R] How do I split a vector into two columns to create ordered pairs for random assignment

I am trying to generate random pairs from 34 subjects for an experiment. Subjects will be assigned ID #'s 1-34. To generate the random ordered numbers (1-34) I used the following code: ### Getting a vector of random ordered numbers 1-34### pairs<-sample(1:34,34,replace=F) pairs [1] 16 22 8 13 4 25 18 12 17 5 6 31 29 27 30 ...

Linux shell (bash) on vi's splitview

Hi all, I've been searching with no results for an integration of bash inside vi, as featured in emacs; the problem is: I have vi open with 2 views, one open with :split command, and I want to use bash through the second view, while I'm editing a file in the first; if I do :sh while editing the second view, the whole session pauses and a...

Issues converting csv to xls in Java? Only core Java experience needed - question not related to import.

Hey everyone, First of all, I understand that it's unusual that I want to up-convert like this, but please bear with me. We get these csv files via website export and we have no options to get it in any other form. Now, onto the question: I have this old code that will do this process for me. It basically reads each line, then picks o...

Using the Perl split function, but keeping certain delimiters

I have a string that I need to split on a certain character. However, I only need to split the string on one of those characters when it is flanked by digits. That same character exists in other places in the string, but would be flanked by a letter -- at least on one side. I have tried to use the split function as follows (using "x" ...

String, split. need help understanding

Case 1 String a = " "; String[] b = a.split(","); System.out.println(b.length); Prints 1. Why? Case 2 String a = ",,,,,,,,,,,,"; String[] b = a.split(","); System.out.println(b.length); Prints 0. Why? Honestly, i am at a loss here ...