Questions tagged [delimiter]

A delimiter is a sequence of one or more characters used to specify the boundary between separate, independent regions in plain text or other data streams.

A delimiter (Wikipedia) is a sequence of one or more characters used to specify the boundary between separate, independent regions in plain text or other data streams. An example of a delimiter is the comma character, which acts as a field delimiter in a sequence of comma-separated values.

See also:

3001 questions
52
votes
6 answers

Hive load CSV with commas in quoted fields

I am trying to load a CSV file into a Hive table like so: CREATE TABLE mytable ( num1 INT, text1 STRING, num2 INT, text2 STRING ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ","; LOAD DATA LOCAL INPATH '/data.csv' OVERWRITE INTO TABLE mytable; …
Martijn Lenderink
  • 535
  • 1
  • 5
  • 5
50
votes
3 answers

Include )" in raw string literal without terminating said literal

The two characters )" terminate the raw string literal in the example below. The sequence )" could appear in my text at some point, and I want the string to continue even if this sequence is found within it. R"( Some Text)" )"; //…
Andreas DM
  • 10,685
  • 6
  • 35
  • 62
49
votes
6 answers

How can I split by 1 or more occurrences of a delimiter in Python?

I have a formatted string from a log file, which looks like: >>> a="test result" That is, the test and the result are split by some spaces - it was probably created using formatted string which gave test some constant…
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
48
votes
0 answers

What delimiters can you use in sed?

We normally see people complaining about the unknown option to s' error in sed when they want to use a pattern that contains the sed delimiter. For example, if we are using /: $ var="hel/lo" $ sed "s/a/$var/g" <<< "haha" sed: -e expression #1, char…
fedorqui
  • 275,237
  • 103
  • 548
  • 598
47
votes
2 answers

Split String by delimiter position using oracle SQL

I have a string and I would like to split that string by delimiter at a certain position. For example, my String is F/P/O and the result I am looking for is: Therefore, I would like to separate the string by the furthest delimiter. Note: some of my…
Avinesh Kumar
  • 1,389
  • 2
  • 17
  • 26
45
votes
10 answers

String delimiter in string.split method

I have following data: 1||1||Abdul-Jabbar||Karim||1996||1974 I want to delimit the tokens. Here the delimiter is "||". My delimiter setter is: public void setDelimiter(String delimiter) { char[] c = delimiter.toCharArray(); this.delimiter =…
Vicky
  • 16,679
  • 54
  • 139
  • 232
45
votes
2 answers

How to use cut with multiple character delimiter in Unix?

My file looks like this abc ||| xyz ||| foo bar hello world ||| spam ham jam ||| blah blah I want to extract a specific column, e.g. I could have done: sed 's/\s|||\s/\\t/g' file | cut -f1 But is there another way of doing that?
alvas
  • 115,346
  • 109
  • 446
  • 738
42
votes
7 answers

Split a string into words by multiple delimiters

I have some text (meaningful text or arithmetical expression) and I want to split it into words. If I had a single delimiter, I'd use: std::stringstream stringStream(inputString); std::string word; while(std::getline(stringStream, word,…
Sergei G
  • 1,550
  • 3
  • 24
  • 44
40
votes
3 answers

How to use delimiter for CSV in Python?

I'm having trouble with figuring out how to use the delimiter for csv.writer in Python. I have a CSV file in which the strings separated by commas are in single cell and I need to have each word in each individual cell, e.g: 100 , 2559 ,,Main,…
hydi
  • 425
  • 1
  • 4
  • 8
39
votes
10 answers

When to use the terms "delimiter," "terminator," and "separator"

What are the semantics behind usage of the words "delimiter," "terminator," and "separator"? For example, I believe that a terminator would occur after each token and a separator between each token. Is a delimiter the same as either of these, or…
Tim Lehner
  • 14,813
  • 4
  • 59
  • 76
39
votes
2 answers

Escaping colons in YAML

Does anyone know how to escape colons in YAML? The key in my yml is the domain with port number, but the yml file isn't working with this setup: ###BEGIN production: ### THIS IS THE ONE I'm HAVING TROUBLE WITH ### 8.11.32.120:8000:…
user2071444
37
votes
3 answers

Escaping separator within double quotes, in awk

I am using awk to parse my data with "," as separator as the input is a csv file. However, there are "," within the data which is escaped by double quotes ("..."). Example filed1,filed2,field3,"field4,FOO,BAR",field5 How can i ignore the comma ","…
joomanji
  • 473
  • 1
  • 4
  • 6
34
votes
10 answers

Split function in oracle to comma separated values with automatic sequence

Need Split function which will take two parameters, string to split and delimiter to split the string and return a table with columns Id and Data.And how to call Split function which will return a table with columns Id and Data. Id column will…
AKBAR ALI
  • 357
  • 1
  • 3
  • 3
32
votes
5 answers

Convert Comma Separated column value to rows

I have a table Sample with data stored like below Id String 1 abc,def,ghi 2 jkl,mno,pqr I need the output like.. Id processedrows 1 abc 1 def 1 ghi 2 jkl 2 mno 2 pqr How can I do the same with a select query in…
mhn
  • 2,660
  • 5
  • 31
  • 51
31
votes
3 answers

Backslash zero delimiter '\0'

I have seen '\0' to be used as a delimiter in mixed binary files (UTF8 strings + binary data). Could anyone explain what '\0' means or point to a good place to study?
bancer
  • 7,475
  • 7
  • 39
  • 58