split

Tracking a fragment of a file in two places with git

Hi, I have code such as void myfunc() { introduction(); while(condition()) { complex(); loop(); interior(); code(); } cleanup(); } which I wish to duplicate into two versions, viz: void myfuncA() { introduction(); minorchangeA(); while(condition()) { complex(); loop(); interior(); ...

bash split text into limited character buckets (array member)

i have text such as http://pastebin.com/H8zTbG54 we can say this text is set of rules splitted by "OR" at the end of lines i need to put set of lines(rules) into buckets (bash array members) but i have character limit for each array member which is 1024 so each array member should contain set of rules but character count for each ...

Split an array, not working

Hi OK I need to figure out how to count how many numbers are in the following example. 07000000000,07000000001,07000000002,07000000003,07000000004 etc... I have tried the following PHP functions. explode, implode, count, foreach and for. None of them seemed to have worked and I am really stuck now. Any help will is appriciated. Ky...

xsl:variable contains nodeset. How to output nth node of variable?

I am transforming an XML document. There is an attribute @prettydate that is a string similar to "Friday, May 7, 2010". I want to split that string and add links to the month and the year. I am using the exslt:strings module and I can add any other necessary EXSLT module. This is my code so far: <xsl:template match="//calendar"> ...

Trouble with arrays

Hi guys, I have such string in PHP: $data = '1;3;5;7;9'; And cycle: for ($i=0; $i < count($someArray); $i++) { // If $i == any number in $data } What is the faster way to compare $i from cycle with numbers in string. I have to check that cycle-counter is in string. ...

Get n Number of words using regex in Java

I have a section of a book, complete with punctuation, line breaks etc. and I want to be able to extract the first n words from the text, and divide that into 5 parts. Regex mystifies me. This is what I am trying. I creates an array of index size 0, with all the input text: public static String getNumberWords2(String s, int nWords){ ...

How to split a git repository while preserving subdirectories?

What I want is similar to this question. However, I want the directory that is split into a separate repo to remain a subdirectory in that repo: I have this: foo/ .git/ bar/ baz/ qux/ And I want to split it into two completely independent repositories: foo/ .git/ bar/ baz/ quux/ .git/ qux/ # Note: still a subdire...

filter lists that are split by easylistsplitter.js?

Hi Everyone, At my site - jasondaydesign.com. I'm using easylistsplitter.js. I designed it this way, because I actually wanted a masonry.js style layout but I couldn't find a way to filter divs. So I made the switch to lists, and found a plugin that allowed me to have a masonry style layout. Unfortunately, I have tried several list fil...

how to extract data from csv file in php

I have a csv file which looks like this $lines[0] = "text, with commas", "another text", 123, "text",5; $lines[1] = "some without commas", "another text", 123, "text"; $lines[2] = "some text with commas or no",, 123, "text"; And I would like to have a table: $t[0] = array("text, with commas", "another text", "123", "text","5"); $t[1]...

How can I get two numbers that are written in a single line - is there a Split() method?

I want to ask the user for input in console. He'll be writing down two numbers separated by a single space. In Java is there something like the C# Split() method I can use? Thank you! ...

Filter jquery split list

see: http://jasondaydesign.com/index2.html I am using easylistsplitter.js to layout the portfolio items. Unfortunately, my filter does not work on all of the items. It only filters the first column. Thoughts? Thanks! ...

Split large text string into variable length strings without breaking words and keeping linebreaks and spaces

I am trying to break a large string of text into several smaller strings of text and define each smaller text strings max length to be different. for example: "The quick brown fox jumped over the red fence. The blue dog dug under the fence." I would like to have code that can split this into smaller lines and have the first li...

javascript split string on space or on quotes to array

var str = 'single words "fixed string of words"'; var astr = str.split(" "); // need fix i want the array to be like: single, words, fixed string of words. ...

Java split is eating my characters.

Hi, I have a string like this String str = "la$le\\$li$lo". I want to split it to get the following output "la","le\\$li","lo". The \$ is a $ escaped so it should be left in the output. But when I do str.split("[^\\\\]\\$") y get "l","le\\$l","lo". From what I get my regex is matching a$ and i$ and removing then. Any idea of how to g...

How to use linux csplit to chop up massive XML file?

Hi everyone, I have a gigantic (4GB) XML file that I am currently breaking into chunks with linux "split" function (every 25,000 lines - not by bytes). This usually works great (I end up with about 50 files), except some of the data descriptions have line breaks, and so frequently the chunk files do not have the proper closing tags - an...

split line of text

Hi all, I was wondering if there is an algorithm to split a line into multiple lines, so that the resulting set of multiple lines fit into a squared shape rather than a wide rectangular shape. Let me give some examples, Input: Hi this is a really long line. Output: Hi this is a really long line Input: a b c d e f Output: a b c d e...

Print one word from a string in python

Hi, How can i print only certain words from a string in python ? lets say i want to print only the 3rd word (which is a number) and the 10th one while the text length may be different each time mystring = "You have 15 new messages and the size is 32000" thanks. ...

Java spliting strings

Hi I've got a Java problem. I'm trying split a string when ever a " " occurs, for example the sentence test abc. Then move the first letter in each word from first to last. I got the moving the letter to work on the original string using String text = JOptionPane.showInputDialog(null,"Skriv in en normal text:"); char firstLetter = te...

Using LINQ, need help splitting a byte array on data received from Silverlight sockets

The message packats received contains multiple messages deliniated by a header=0xFD and a footer=0xFE // sample message packet with three // different size messages List<byte> receiveBuffer = new List<byte>(); receiveBuffer.AddRange(new byte[] { 0xFD, 1, 2, 0xFE, 0xFD, 1, 2, 3, 4, 5, 6, 7, 8, 0xFE, 0xFD, 33, 65, 25, 44, 0xFE}...

php split array into smaller even arrays

I have a function that is supposed to split my array into smaller, evenly distributed arrays, however it seems to be duplicating my data along the way. If anyone can help me out that'd be great. Here's the original array: Array ( [0] => stdClass Object ( [bid] => 42 [name] => Ray White Mordialloc ...