delimiter

Ignoring escaped delimiters (commas) with awk?

If I had a string with escaped commas like so: a,b,{c\,d\,e},f,g How might I use awk to parse that into the following items? a b {c\,d\,e} f g ...

Using MySQL LOAD DATA INFILE with nonprintable character delimiters

I have some vendor data that has the SOH (ASCII character 1) as the field delimiter and STX (ASCII character 2) as the record delimiter. Is it possible to load this data with LOAD DATA INFILE without pre-processing the file and replacing those characters with something more common? ...

Java Scanner Headache

I have a text file which looks like: name1 1 0 1 0 1 0 1 1 1 0 0 0 0 0 0 name2 1 0 1 0 1 0 0 1 1 0 0 0 0 0 1 i.e., a plaintext label followed by a few rows with 1/0 separated by spaces. The number of rows of 1/0 is variable, but each row between any two particular labels should have the same number of 1/0s (though might potentially n...

Java Scanner Delimiter Usage

I'd like to specify a delimiter for a scanner that splits on some pattern, but doesn't remove that pattern from the tokens. I can't seem to make this work, as anything that is identified by the regex also gets eaten as part of the delimiter. Any suggestions? My specific problem, I have file that looks like: text/numbers mix numbers n...

Using a php function using a variable with delimiters

I would like to know If I can use a php function on a variable that contains delimiters like ' or ". I'm receiving a text content from my database and I would like to use: strip_tags($desc); on it but it does not work. Here is an example of what it can contain using var dump: string(1039) ""txt <a href=""/txt.php"" class=""txt"">txt</a...

best way to parse a line in python to a dictionary

I have a file with lines like account = "TEST1" Qty=100 price = 20.11 subject="some value" values="3=this, 4=that" There is no special delimiter and each key has a value that is surrounded by double quotes if its a string but not if it is a number. There is no key without a value though there may exist blank strings which are represen...

inline dynamic string in ascx

This doesn't execute the delimiter (its displayed verbatim in the confirm dialog). Why not? Also, that variable is set in the codebehind, but is ready by the time PreRender gets called, so I should be OK right? <asp:LinkButton ... OnClientClick= "return confirm('Are you sure you want to remove Contract Period <%= Contract...

Is There An Efficient Whole Word Search Function in Delphi?

In Delphi 2009 or later (Unicode), are there any built-in functions or small routines written somewhere that will do a reasonably efficient whole word search where you provide the delimiters that define the word, e.g.: function ContainsWord(Word, Str: string): boolean; const { Delim holds the delimiters that are on either side of the ...

Best approach to parse text files that contain multiple types of delimiters?

I need to parse some text files that have different types of delimiters (tildes, spaces, commas, pipes, caret characters). There is also a different order of elements depending on what the delimiter is, e.g: comma: A, B, C, D, E caret: B, C, A, E, D tilde: C, A, B, D, E The delimiter is the same within the file but different from one...

problem with stringtokenizer

Hi all, i want to parse the following using StringTokenizer for every string matching "agent>". I tried it using the code like this. Please let me know where i am going wrong. StringTokenizer stringtokenizer=new StringTokenize(hari,"agent>"); while(stringtokenizer.hasMoreTokens()) { String token = stringtokenizer.nextToken(); ...

How to convert URL string with multiple delimiters into another string in PHP?

So I have this sample string: ?items=3744130|1^356221|2^356222|1 extracted from a URL: http://www.example.com/process.php?items=3744130|1^356221|2^356222|1 I need to convert it into this, and for the life of me I'm getting stuck. ?items=model_1=3744130&qty_1=1&model_2=356221&qty_2=2&model_3=356222&qty_3=1 I've gotten this far bu...

Reading a csv file in Python with different line terminator

I have a file in CSV format where the delimiter is the ASCII unit separator ^_ and the line terminator is the ASCII record separator ^^ (obviously, since these are nonprinting characters, I've just used one of the standard ways of writing them here). I've written plenty of code that reads and writes CSV files, so my issue isn't with Pyt...

Explode- sort of?

Using PHP, reading in a string like the following: 36,2,"$21,830.00","$18,012.50","$20,764.00","$14,935.00","$13,655.00","$15,820.00","$6,895.00","$4,357.50","$4,944.00" I want to explode using the comma (,) as a delimiter, but I've realized there's a problem- my money values also have commas! Can anyone suggest a way to handle this? I ...

Re-format items inside list read from CSV file in Python

I have some lines in a CSV file like this: 1000001234,Account Name,0,0,"3,711.32",0,0,"18,629.64","22,340.96",COD,"20,000.00",Some string,Some string 2 If you notice, some numbers are enclosed in " " and has a thousand separator ",". I want to remove the thousand separator and the double quote enclosure. For the qoute enclosure, I'm t...

bcp and backspace (^H) delimiter

I need to parse a flat file which is containing backspace (^H) character delimiter between fields. I need to parse this file and insert into sql server 2005 tables.I tried to use bcp utility along with the format file but I wasn't able to specify the delimiter as backspace. The default one is tab (\t). There are several other delimiters ...

how do I parse a ',' separated char string using c?

What is the easiest way of parsing a comma separated list, where there can be zero elements between each token. The cstring could look like 1, 3, 4, 5, 6, 7, 8, .... But could also look like , , , , , , , , , ... I've tried something like: char *original = "1, 3, 4, 5, 6, 7, 8, ...." char *tok = strtok(original," ,") while(tok!=NU...

Backspace delimited flat files

Has any one ever seen a backspace delimited flat file? My requirement is to parse such a file but I am not able to put a backspace character into a file to check if I am able to detect it. ...

Parsing backspace delimted text files using sqlserver 2005

I need to parse a backspace delimited flat file using sqlserver 2005 and update in some tables. What is the best way to go about it? ...

MySQL/phpMyAdmin freezes from DELIMITER

Running this procedure causes MySQL (or phpMyAdmin) to freeze. I have to stop MySQL with from XAMPP command, which freezes and "is not responding" about 20 seconds before stopping. I believe this is caused by the delimiter command, which on it's own begins the problems. I have tried using a different delimiter ("//") to no effect. Any h...

How can I make this work with every delimiter? - C++

Hi, I just wrote a program that tokenizes a char array using pointers. The program only needed to work with a space as a delimiter character. I just turned it in and got full credit, but after turning it in I realized that this program only worked if the delimiter character was a space. My question is, how could I make this program wor...