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:

2697 questions
1087
votes
14 answers

How do I escape a single quote in SQL Server?

I'm trying to insert some text data into a table in SQL Server 9. The text includes a single quote('). How do I escape that? I tried using two single quotes, but it threw me some errors. eg. insert into my_table values('hi, my name''s tim.');
tim_wonil
  • 12,402
  • 5
  • 25
  • 41
720
votes
2 answers

C# List to string with delimiter

Is there a function in C# to quickly convert some collection to string and separate values with delimiter? For example: List names --> string names_together = "John, Anna, Monica"
nan
  • 17,478
  • 6
  • 43
  • 74
601
votes
5 answers

Split string with multiple delimiters in Python

I found some answers online, but I have no experience with regular expressions, which I believe is what is needed here. I have a string that needs to be split by either a ';' or ', ' That is, it has to be either a semicolon or a comma followed by a…
gt565k
  • 6,135
  • 3
  • 13
  • 9
423
votes
19 answers

Can you use a trailing comma in a JSON object?

When manually generating a JSON object or array, it's often easier to leave a trailing comma on the last item in the object or array. For example, code to output from an array of strings might look like (in a C++ like…
Ben Combee
  • 15,807
  • 6
  • 37
  • 40
320
votes
5 answers

How to make the 'cut' command treat same sequental delimiters as one?

I'm trying to extract a certain (the fourth) field from the column-based, 'space'-adjusted text stream. I'm trying to use the cut command in the following manner: cat text.txt | cut -d " " -f 4 Unfortunately, cut doesn't treat several spaces as one…
mbaitoff
  • 7,835
  • 4
  • 21
  • 32
295
votes
7 answers

How to escape indicator characters (i.e. : or - ) in YAML

In a config file, I have a key to which I wish to assign a URL. The problem is that YAML interprets : and - characters as either creating mappings or lists, so it has a problem with the line url: http://www.example-site.com/ (both because of the…
danieltahara
  • 3,695
  • 3
  • 15
  • 20
217
votes
12 answers

How to specify more spaces for the delimiter using cut?

Is there any way to specify a field delimiter for more spaces with the cut command? (like " "+) ? For example: In the following string, I like to reach value '3744', what field delimiter I should say? $ps axu | grep jboss jboss 2574 0.0 0.0 …
leslie
  • 10,530
  • 7
  • 20
  • 22
187
votes
6 answers

Eclipse and Windows newlines

I had to move my Eclipse workspace from Linux to Windows when my desktop crashed. A week later I copy it back to Linux, code happily, commit to CVS. And alas, windows newlines have polluted many files, so CVS diff dumps the entire file, even when I…
Vasu
  • 2,316
  • 3
  • 18
  • 26
178
votes
4 answers

Delimiters in MySQL

I often see people are using Delimiters. I tried myself to find out what are delimiters and what is their purpose. After 20 minutes of googling, I was not able to find an answer which satisfies me. So, my question is now: What are delimiters and…
System.Data
  • 3,608
  • 6
  • 27
  • 40
101
votes
4 answers

Python split() without removing the delimiter

This code almost does what I need it to.. for line in all_lines: s = line.split('>') Except it removes all the '>' delimiters. So, Turns into ['
some1
  • 2,091
  • 8
  • 22
  • 23
86
votes
9 answers

SQL split values to multiple rows

I have table : id | name 1 | a,b,c 2 | b i want output like this : id | name 1 | a 1 | b 1 | c 2 | b
AFD
  • 901
  • 1
  • 7
  • 8
85
votes
19 answers

Split a string into an array of strings based on a delimiter

I'm trying to find a Delphi function that will split an input string into an array of strings based on a delimiter. I've found a lot on Google, but all seem to have their own issues and I haven't been able to get any of them to work. I just need to…
Ryan
  • 6,875
  • 7
  • 50
  • 88
84
votes
16 answers

Least used delimiter character in normal text < ASCII 128

For coding reasons which would horrify you (I'm too embarrassed to say), I need to store a number of text items in a single string. I will delimit them using a character. Which character is best to use for this, i.e. which character is the least…
Too embarrassed to say
83
votes
1 answer

str.format() raises KeyError

The following code raises a KeyError exception: addr_list_formatted = [] addr_list_idx = 0 for addr in addr_list: # addr_list is a list addr_list_idx = addr_list_idx + 1 addr_list_formatted.append(""" "{0}" { …
Dor
  • 6,916
  • 4
  • 28
  • 45
77
votes
13 answers

Capturing output of find . -print0 into a bash array

Using find . -print0 seems to be the only safe way of obtaining a list of files in bash due to the possibility of filenames containing spaces, newlines, quotation marks etc. However, I'm having a hard time actually making find's output useful within…
Idris
  • 1,777
  • 1
  • 13
  • 9
1
2 3
99 100