FAQ Database Discussion Community


R: Import CSV with double quotes only on text

r,import,double-quotes
I am trying to import a CSV where the text columns are in double quotes but the numeric columns are not. I have 95 columns in total so I cannot manually modify the columns. (Note: There are commas in the text that I cannot remove) Below is a sample data...

bash:variable with double quotes

bash,double-quotes
I am a newbie to bash script programming and when I learned the variable expansion I amd puzzled by the variable. 1.when I want to define a variable,I can do as following: name=foo name="foo" name='foo' what's the difference between themm? 2.when I want to print a variable,I can do as...

Get string within double quotes along with rest of the string

java,regex,string,double-quotes
I have a case where I need to extract the string within double quotes in one var and the rest of the string in another var. Two possibilities: String: "Franklin B" Benjamin Result: var1 = Franklin B var2 = Benjamin String: Benjamin "Franklin B" Result: var1 = Benjamin var2 =...

When to use quotes in command line? cp versus find

command-line,terminal,quotes,double-quotes,cp
I'm wondering if there is some pattern or trick to remember when or when not to use quotes in command line arguments. e.g. what is the difference between: find -type f -name "*<extension-with-quotes>" and cp <extension-without-quotes> ../<new-folder> One needs quotes and one does not, else it gives an error. Why?...

Pipe in for loop breaks double quoted variables

batch-file,for-loop,pipe,environment-variables,double-quotes
Situation: Using batchscript to retrieve certain values from a JSON. I've got the following batchscript: @ECHO off ECHO Enter npo.nl program-url : SET url= SET /P url= :: http://www.npo.nl/buitenhof/03-05-2015/VPWON_1232766/POMS_VPRO_850040 for example SETLOCAL ENABLEDELAYEDEXPANSION FOR /F "tokens=6 delims=/" %%A IN ("%url%") DO ( FOR /F "delims=" %%B IN ('curl.exe -s http://e.omroep.nl/metadata/aflevering/%%A...

Quotes within quotes

python,string,python-3.x,double-quotes
In Python 3.x: print(""s"") # SyntaxError print("""s""") # prints s print(""""s"""") # SyntaxError print("""""s""""") # prints ""s What is the reason behind this different behaviour, when there are different numbers of double quotes in the string?...

Why does Python use different quotes for representing strings depending on their content?

python,string,quotes,double-quotes
In Python 2.7, I noticed that repr(s) (with s being a string) behavior differs depending on s's content. Here is what I mean: In [1]: print repr("John's brother") "John's brother" In [2]: print repr("system") 'system' Note the different quotes type in both case. From my tests it seems that whenever...

PHP preg_match double quote matching

php,regex,double,double-quotes
I'm a newbie, and a bit of a regex dullard, so please forgive me what will appear to be a completely stupid question. In PHP I'm trying to use a regex to match when a double quote " appears in text from a control on an HTML form and allow...

input field showing an URL with quotes

php,mysql,quotes,mariadb,double-quotes
I have to store some Wikipedia URLs into a MariaDB database. It happens that some URLs contain quotes, like this one: https://en.wikipedia.org/wiki/%22Heroes%22 so I use urlencode() to store them as "en.wikipedia.org%2Fwiki%2F%22Heroes%22". If I urldecode() the URL, to show it inside an <input type="text"> field without all the % (they scare...

Grails - escape double quotes in params

grails,quotes,double-quotes
I have an array of strings that looks like this when I print it on the webpage with ${projectList}: [foo,bar,foo "bar"] And I have a form with select: <g:select class="form-control sbt-color" name='project' value ='${params.project.encodeAsHTML()}' from='${projectList}'/> If I choose 'foo "bar"' params.project will only get 'foo '. Is there a way...

Smooks is failing to return comma separated values when double quote is encountered in the records

java,csv,double-quotes,smooks
I have a CSV file, I am spcifying "comma" in smooksConfig file as separator. But smooks is failing to retrive values whenever one of the values has double quote(eg.21" TV, 10" Screen) if no double quote in my record, smooks works good. thanks....

Extract string from between group of backsplash and double quote

regex,double-quotes
I want to get string from between \" using regular expression. Input : "gram:\"who is $t34he\"" Expected Ouput : who is $t34he I tried /\\"(.*?)\\"/g this and got \"who is $t34he\" but I don't need \" into the output string. Any solution. Tried on http://www.regexr.com/...

C++: About null characters

c++,operators,stdstring,double-quotes,null-character
There are two string variables, m and n: #include <string> string m = "0100700\0" cout << m.size() << endl; // it prints: 7 string n; n += "0100700" n += '\0'; cout << n.size() << endl; // it prints: 8 I supposed that both had 8 characters, but m had...

Shell script to build CLI args for a PERL script

sh,double-quotes,single-quotes
I have a Jenkins job, triggered as a parameterized build. It accepts an optional String parameter (HOSTNAMES) that can be a comma separated list of hostnames. I need to pass this comma separated list of hostnames as a command line argument to a PERL script (within Execute shell build step)....

export csv: enclose key with quotes in mysql

mysql,csv,double-quotes,sqlyog
I am exporting a mysql table to csv using SQLYog. I can get all the fields enclosed with " ", except for the id column which is first, primary key and set to int. I've tried removing the primary key and changing the id column to text, but to no...

quotes in Jquery selectors

jquery,double-quotes,single-quotes
I read a couple of answer about a similar question and people always say that there is no difference between a single and a double quote. The problem is I have a little line of code that somehow seem to matter... $("li[data-type|='veg']").append(' (v)'); this code do what I want him...