split

HowTo get a Map from a csv string

Hi, I'm fairly new to Scala, but I'm doing my exercises now. I have a string like "A>Augsburg;B>Berlin". What I want at the end is a map val mymap = Map("A"->"Augsburg", "B"->"Berlin") What I did is: val st = locations.split(";").map(dynamicListExtract _) with the function private def dynamicListExtract(input: String) = { if (inp...

Split a string array into pieces

let said I have an array that store like this. Array ( [0] => width: 650px;border: 1px solid #000; [1] => width: 100%;background: white; [2] => width: 100%;background: black; ) How should I make the array[0] string split into piece by separated the ";"? Then I want to save them in array again, or display them out. How sh...

C# String splitting - breaking string up at second comma

Hi I have a string like so: mystring = "test1, 1, anotherstring, 5, yetanother, 400"; myarray can be of varying length. What I would like to do is split the string up like so: {"test1, 1"} {"anotherstring, 5} {"yetanother, 400"} Is this possible? I tried string[] newArray = mystring.Split(',') but that splits it at every comma, a...

Having trouble with Splitting text.

Here's the code I'm using : public class splitText { public static void main(String[] args) { String x = "I lost my Phone. I shouldn't drive home alone"; String[] result = x.split("."); for (String i : result) { System.out.println(i); } } } Compiles perfectly, but nothing happens at runtime. What am I doing wro...

BASH: Split MAC Address -> 000E0C7F6676 to 00:0E:0C:7F:66:76

Hy, Can someone help me with splitting mac addresses from a log file? :-) This: 000E0C7F6676 should be: 00:0E:0C:7F:66:76 Atm i split this with OpenOffice but with over 200 MAC Address' this is very boring and slow... It would be nice if the solution is in bash. :-) Thanks in advance. ...

remove certain lines from a StringBuffer

A legacy app program has a huge String Buffer (size sometimes upto an Mb) and it is processed sequentially for modifying the contents. I have to implement a change wherein I need to update the string buffer to remove some lines starting with certain specific words. What are the possible ways to implement this ? Ex: ABC:djfk kdjf kdsjfk...

Splitting comma delimited cell data

I have a spreadsheet with multiple columns, one of which is an owner_id column. The problem is that this column contains a comma delimited list of owner id's and not just a single one. I've imported this spreadsheet into my sql database (2008) and have completed other importing tasks and now have a parcel_id column as a result of this p...

iphone string initial char before space

Hi all! I have a question... I wish take from a string that contains a name and surname, the initial of the first and the surname complete.... example: NSString* myName = @"Mel Gibson"; //I Wish have "M Gibson"; NSString* myName2 = @"Leonardo Di Caprio"; //I wish have "L Di Caprio"; Thanks ...

how to get ID from file

how to get 3 from 3.hpdf if it is a big int then how can i get it ...

Split interactive Keynote .mov (Quicktime) to one .mp4 file per slide

Hallo everyone, i wonder if someone knows a solution to my problem. I have a Keynote presentation with a lot of animations. I converted/exported this keynote presentation to a interactive .mov (Quicktime) movie. It means that you can use Quicktime to play this converted presentation movie and advance in the slides by pressing any key or...

How to split to the right of a number?

I'm trying to use Ruby to split to the right of a number. For example: H2SO4 How do you do this? I'd like to output ["H2", "SO4"] x.split(/\d+/) yields: ["H", "SO"] x.split(//) yields: ["H", "2", "S", "O", "4"] Both cool but not exactly what I'm looking for. ...

Java File Splitting

What will be the most eficient way to split a file in Java ? Like to get it grid ready... (Edit) Modifying the question. Basically after scouring the net I understand that there are generally two methods followed for file splitting.... Just split them by the number of bytes I guess the advantage of this method is that it is fast, bu...

How to split between two capital letters?

I have the following array: a = ["CH3", "CH2"] and I'd like to split this between two capital letters using a reg expression to display: a= ["C", "H3", "C", "H2"] How do you do this? so far I've tried: a.each { |array| x = array.scan(/[A-Z]*/) puts a } returns: CH CH Thanks in advance! ...

Best way to split several heads from a list with Erlang?

So, Erlang is a real joy to work with, but there's one problem I run into occasionally, that I'm wondering if there is a nicer way to solve. Often, I find myself needing to split several items from a list. The syntax for splitting a list into a Head and Tail is straight forward enough, but what about when there are multiple items. 1> Li...

How to split a string into an array

I have a string of attribute names and definitions. I am trying to split the string on the attribute name, into a Dictionary of string string. Where the key is the attribute name and the definition is the value. I won't know the attribute names ahead of time, so I have been trying to somehow split on the ":" character, but am having trou...

Does xslt have split() function?

i want to split the string based on some separator. for e.g returns Topic1,Topic2,Tpoic3 as string. i want to split the string based on ",", the way we have in C#. Final output should be Topic1 Topic2 Topic3. Regards, Ketan ...

Product code looks like abcd2343, what to split by letters and numbers

I have a list of product codes in a text file, on each like is the product code that looks like: abcd2343 abw34324 abc3243-23A So it is letters followed by numbers and other characters. I want to split on the first occurrence of a number. ...

split string for firstname and lastname in vb.net

i have a string that comes in say "Joesph Van Andrews". I want to split it in such a way that firstname is "Joseph" and lastname is "Van Andrews" how can i do that in vb.net? ...

Preseve line breaks from textarea in Rails controller submitted with submit_to_remote

I can't believe there isn't a standard way of doing this, but I'm submitting content from a textarea to a Rails controller, and it doesn't seem to preserve the line breaks (of any form). Here is my view code: f.text_area :keywords, :cols => 50, :rows => 10 submit_to_remote 'button', "#{t "add_keywords"}", :html => {:id => 'add...

short regex datetime split

Hi, I'm trying to split the following: 2010-07-30 10:10:50 and I would like to ONLY end up with: 2010 07 30 normally with just the date, you regex with /-/ however now I would like something as simple as that but now i get 2010 07 30 10:10:50 how can i get that last part + space out? Thank you so much! ps, right now I need t...