split

How can read a file, split the strings in it, and write the output to a hashtable in C#?

I need to read file and split string into hash table in C#. For example; 1231231 Hi this is the first entry / hi this is the second entry Currently, I'm reading the lines in the files line by line using a StreamReader, and then I splitting every line to 3 different strings. For example, "1231231" to one string, then up to "/" sign to...

Regex for splitting

I'd like to split a string such as "[1-5]?3456[2-5][4-D]" to array[0] = "[1-5]" array[1] = "?" array[2] = "3" array[3] = "4" array[4] = "5" array[5] = "6" array[6] = "[2-5]" array[7] = "[4-D]" Can anybody tell me if that's possible with a regex that splits? I got three elements "3" a letter (which can be 1-9 and A-F, "?" a whiteca...

Splitting a multipage TIFF image - With .NET and IronPython

I had a scanned multipage TIFF image and needed to split each page out into individual files. This is easy to do in by leveraging the .NET framework and C#, but since I did not have all the development tools installed on the machine I was using, I instead opted to use IronPython (via ipy.exe) to quickly script the processing logic. Usi...

How do I split a string that contains different signs?

I want to split a string that can look like this: word1;word2;word3,word4,word5,word6.word7. etc. The string is from an output that I get from a php page that collects data from a database so the string may look different but the first words are always separated with ; and then , and the last words with .(dot) I want to be able to fet...

Split String at specific character

I have the following code: var string = "word1;word2;word3,word4,word5,word6.word7"; function ends_with(string, character) { var regexp = new RegExp('\\w+' + character, 'g'); var matches = string.match(regexp); var replacer = new RegExp(character + '$'); return matches.map(function(ee) { return ee.replace(replacer, ''); }...

javascript for() loop, split(), and array question

Ok I've been asking alot of JS questions lately, and realized I just need to go learn it. Been following tutorials at http://www.tizag.com/javascriptT very simple and straightforward. I just want to make sure I understand this correctly. It took me a while to get it: <script type="text/javascript"> var myString = "zero one two three f...

PHP Simple HTML DOM Parser problem with split()

I want to use the PHP Simple HTML DOM Parser to display all my Left4Dead Steam achievements on my website. The achievements list on the steam community website looks something like this: <img src="…" /><br /> <div class="achieveImgHolder"><img src="…" /></div> <div class="achieveTxtHolder"> <img src="…" /> <div class="achieveTxt"> <...

Convert PDF pages to images with COCOA

Hi, I am having problem with PDF conversion to images. I would like to create an image file for every page in PDF document. This is the code I am using and works fine. Every page gets converted into the image, but I have problem with image resolution. I don't know how to set the resolution of the output images. Can someone help me out?...

How can I split an ArrayList into several lists?

Hi, See the following ArrayList: List<Integer> values = new ArrayList<Integer>(); values.add(0); values.add(1); values.add(2); values.add(3); values.add(4); values.add(5); values.add(6); So we have: integerList.size(); // outputs 7 elements I need to show a Google chart as follows: http://chart.apis.google.com/chart?chs=300x20...

Excel: Putting together two different complex formulas (Unique distinct list & Split)

Hello all you amazing people I wanted to do two things populate a unique distinct list from a long list of repetitive values extract component of a text delimited with hyphen I found solutions to each one of these problems at different places. Unique distinct list here: http://www.get-digital-help.com/2009/03/30/how-to-extract-a-un...

split a generator/iterable every n items in python (splitEvery)

I'm trying to write the Haskel function 'splitEvery' in Python. Here is it's definition: splitEvery :: Int -> [e] -> [[e]] @'splitEvery' n@ splits a list into length-n pieces. The last piece will be shorter if @n@ does not evenly divide the length of the list. The basic version of this works fine, but I want a version tha...

split a string using find_if

Hi, I found the following code in the book "Accelerated C++" (Chapter 6.1.1), but I can't compile it. The problem is with the find_if lines. I have the necessary includes (vector, string, algorithm, cctype). Any idea? Thanks, Jabba bool space(char c) { return isspace(c); } bool not_space(char c) { return !isspace(c); } vector<s...

Split a long string into a substring based on a count of chars in C#

I want to split a long string which looks something like this weygjjsgdgkweygwjiewlewegygciefewjknfkeuwyfjkdygwfsn into "weygjjsgdgk" "weygwjiewle" "wegygciefew" "jknfkeuwyfj" "kdygwfsn" in chunks of 10 chars...and format it like "" outside...how can I do this? ...

Find position of delimited character in a String (SQL Server)

Hi All, I have a string Variable test=HARIA|123|MALE|STUDENT|HOUSEWIFE i am using | as delimited character. if i want to extract data from 2nd occurence of pipe till 3rd occurrence. i need to get 'MALE' from above string. any help appreciated ...

7zip, batch file, file splitting, amazon s3

Hi, I try to to use the following batch command to start for each of the files in a the given folder 7zip and split the files into 250 MB pieces. The files should not be zipped (-mx0) because I want have low disk i/o and just want to synchronize them with amazon s3. for /f %%f in ('dir /b c:\Test\') do START 7z.exe a %%f.zip -wc:\Test...

Regex help with splitting string

Hi, I need to be able to parse strings like these: kev-+kvs+-one-+gdl+-greg-+kvs+-two-+gdl+-les-+kvs+-three -+gdl+-kev-+kvs+-one-+gdl+-greg-+kvs+-two-+gdl+-les-+kvs+-three kev-+kvs+-one-+gdl+-greg-+kvs+-two-+gdl+-les-+kvs+-three-+gdl+- and in all three cases recognise these three groups: kev-+kvs+-one greg-+kvs+-two les-+kvs+-th...

need solution for split cell value (string) and view this as link in VIEW in ASP.NET MVC 1 project

In my table i have: id, header, centent and foto columns. In foto column are cells included string values for egxample :(foto1.jpg,foto2.jpg). J split this and the result input to table. I'm trying to view this in Details.aspx. I must view one record from table in my database plus one split cell as links. View the hole record is not the ...

Regex (java) help

How do I split this comma+quote delimited String into a set of strings: String test = "[\"String 1\",\"String, two\"]"; String[] embeddedStrings = test.split("<insert magic regex here>"); //note: It should also work for this string, with a space after the separating comma: "[\"String 1\", \"String, two\"]"; assertEquals("String 1"...

How to hide a divider of nssplitview?

Now I want to hide or show with my condition a divider when my app run. used this delegate method: - (BOOL)splitView:(NSSplitView *)splitView shouldHideDividerAtIndex:(NSInteger)dividerIndex { if (A) return YES; else return NO; } but it didn't work , why? How to used this method? Thank you very much! ...

Split a large string into multiple substrings containing 'n' number of words via python

Source text: United States Declaration of Independence How can one split the above source text into a number of sub-strings, containing an 'n' number of words? I use split(' ') to extract each word, however I do not know how to do this with multiple words in one operation. I could run through the list of words that I have, and create...