split

Split Strings and arrange db to display products in PHP

Hello, I'm new in php. Could you please help me to find the way to properly arrange following task: Table "Products" id - details 1 - 1-30,2-134:6:0;;2-7:55:0;;1-2,2-8:25:0 - where this string can be very long 2 - 3 - 1-360:17:0;;1-361:185:0 Every product 1, 2, 3, ... are stored in db in one row, although product is addition...

sql split string by space into table in postgresql

I looking for a function like regexp_split_to_table, but our db is version 8.2.9, so it doesn't have it. I'm really only splitting on a space, so a string like how now brown cow would return +------+ |Column| +------+ |how | |now | |brown | |cow | +------+ is there a simple function that can handle this, or something I ...

How do you make parentheses match height when they're split between lines in LaTeX math

Consider the following example \begin{equation} \begin{split} f = & \left( \frac{a}{b} + \right. \\ & \left. c \right) + d \end{split} \end{equation} In the result, the left parenthesis on the first line is very large, because of the fraction inside. In the second line, since there is no fraction, t...

How to un-nest nested lists in php

I have a nested unordered list like this (simplified version / the depth is variable) : <ul> <li> <a href="#">Root</a> <ul> <li> <a href="#">Page A</a> <ul> <li> <a href="#" title="Page A1">Page 1 2</a> </li> ...

Python string splitting

If I have a string 'x=10', how can I extract the 10 as an integer using one line of code? ...

Ruby - split a string

Hello! I have a string like " This is a test ". I want to split the string by the space character. I do it like this: puts " This is a test ".strip.each(' ') {|s| puts s.strip} The result is: This is a test This is a test Why is there the last line "This is a test"? And I need, that if there are two or more s...

Split XML tags and transform to SQL

I want to transform a large xml file to sql statements with xslt. For example I have the author tag. <author>Evans, Jim; Henderson, Mike; Coyier, Alan</author> I have a column for last_name and first_name, so Evans, Henderson and Coyier should go to last_name and so on. How can I pick them out of the tag and put it into sql statement...

Log meta-data to be part of entity tables or separate?

Hello. For entities in my application, I am planning to log common meta-data like DateCreated, DateModified, IPAddress, etc. Does it make sense to add these columns in entity tables or is it better to have a single table for logging meta-data where each row has link back to the item that it corresponds to? Later for purpose of reporting ...

Split string in Ruby, ignoring contents of parentheses?

I need to split a string into a list of parts in Ruby, but I need to ignore stuff inside paramentheses. For example: A +4, B +6, C (hello, goodbye) +5, D +3 I'd like the resulting list to be: [0]A +4 [1]B +6 [2]C (hello, goodbye) +5 [3]D +3 But I can't simply split on commas, because that would split the contents of the parentheses...

Split String Value C#

I have a string value which I need to get the middle bit out, e.g. "Cancel Payer" / "New Paperless". These are an example of the string format: "REF_SPHCPHJ0000057_Cancel Payer_20100105174151.pdf" "REF_SPHCPHJ0000056_New Paperless_20100105174151.pdf" ...

How can I reduce these four lines of code that splits/trims a semicolon list to one line?

How can I do this: string list = "one; two; three;four"; List<string> values = new List<string>(); string[] tempValues = list.Split(new char[] {';'}, StringSplitOptions.RemoveEmptyEntries); foreach (string tempValue in tempValues) { values.Add(tempValue.Trim()); } in one line, something like this: List<string> values = extras.Sp...

How would you split by \r\n if String.Split(String[]) did not exist?

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 into lines, which means splitting by \r\n. However, String.Split only provides a split by char, not by string. How can I split a document...

Java string split function acting strange

Hi guys, I am noticing strange behaviour when using the split() method in Java. I have a string as follows: 0|1|2|3|4|5|6|7|8|9|10 String currentString[] = br.readLine().split("\\|"); System.out.println("Length:"+currentString.length); for(int i=0;i < currentString.length;i++){ System.out.println(currentString[i]); } This will p...

split function extension

Hi, I am learning the sample code from split function. Sample code. #!C:\Perl\bin\perl.exe use strict; use warnings; my $info = "Caine:Michael:Actor:14, Leafy Drive"; my @personal = split(/:/, $info); # @personal = ("Caine", "Michael", "Actor", "14, Leafy Drive"); If change the $info = "Caine Michael Actor /* info data */"; How to...

SplitValue function in sql server2008

Hello, I found some table valued function for splitting string in sp and getting values in columns, but when data is huge these functions are became slow. so if anybody has a good function for splitting values separated by commas into rows of a table... please provide me. The link where I found some functions: Click Here ...

Classic asp inline split

How do I split inline in classic asp? Something like this for getting domain: domain=split("[email protected]").item(1) ...

Divide large image into A4 sized images

I would like to split a large PNG file into A4 pages so they can be printed out easily. I would like to use a Linux command line script to do this: shell> split-into-a4-sized-pages some-big.png ...

iPhone : Is it possible to split Localizable.strings in many files

Hi there, I'd like to know if it is possible to "distribute" the translation resources (my "Localizable.strings" files) in many subfiles. Indeed, in my application, I store text articles in many folders, and I'd like to put the translations of each articles just aside the original article, that means in its own folder. To summarize, I...

How to use Regex.Split on this String?

Does anyone know how to write a Regex.Split in order to convert {video="my/video/file.flv,my/location.jpg"} into my/video/file.flv my/location.jpg ...

Sql Splitting Function

I have a string like that "10*cat*123456;12*rat*789;15*horse*365" i want to split it to be like that "cat, rat, horse" I have made this Function CREATE FUNCTION [dbo].[Split](@BenNames VARCHAR(2000)) RETURNS VARCHAR(2000) AS BEGIN DECLARE @tmp VARCHAR(2000) SET @tmp = @BenNames SET @tmp = SUBSTRING( S...