FAQ Database Discussion Community


split comma-separated column entry into rows

r,comma
I have already found other versions of the same question but I was not able to adapt the answers given there for my problem. Here is an older link: The op there had data consisting of two columns only - and the given answer handles this really nicely. But what...

How does ((a++,b)) work? [duplicate]

c,function,recursion,comma
This question already has an answer here: What does the comma operator `,` do in C? 8 answers In the below block of code, I am trying to understand how the line return reverse((i++, i)) is working. #include <stdio.h> void reverse(int i); int main() { reverse(1); } void reverse(int...

MySQL : Left Outer join with in clause integers

mysql,string,int,comma
Table-A: Each record in this table maintains the list of attached documents for a given user Table-B: Each record in this table represents single attached document for a given user. I am trying to get list of all Table-B records for a given user along with Table-A records. Where Table-A...

how to stop “number_to_currency” method from interpreting commas as decimal places for price?

ruby-on-rails,ruby,comma,number-to-currency
In my Ruby on Rails app, I've got a model called Post which has a column named "Price" in it's database table; this column is decimal type with a precision of 8 and scale of 2. The form for a new Post has a 'text_field' for :price, and in the...

List of tuple. Comma instead of point in double values

c#,list,tuples,comma
The situation: I have a list of tuple, in which a tuple is added: List<Tuple<double, double>> list = new List<Tuple<double, double>>(); list .Add(new Tuple<double, double>(2.2, 6.6)); All seems to be ok. But... In Debugging mode, in the list of local vars I see next: [0] {(2,2, 6,6)} System.Tuple<double,double> By the...

What is the output of “cout << (a, b)” and why?

c++,comma
It is possible to combine boolean expressions with a comma separator. I have seen it in a code and i am not sure what this resolves to. I wrote some sample code. int BoolStatement(void) { using std::cout; using std::endl; cout << "(0, 0) => " << (0, 0) << endl;...

C++ Multi-dimensional Array Comma Index Address

c++,arrays,multidimensional-array,comma
In playing around with multi-dimensional arrays, I found that if I used a comma to separate the indices, it would return to me the address of the element in the array, disregarding the first comma. This is shown by the following example: int arr[3][3]; for (int i = 0; i...

Javascript validate list of email addresses comma separated

javascript,list,validation,email,comma
I am using ServiceNow and I need to validate a textbox that will accept a list of email addresses that are separated by commas. The list of email addresses is in the variable group_members. The validation works for the first email address only. The second email address in the list...

Format a command in powershell including a comma, can't find the right way to escape

powershell,batch-file,escaping,powershell-v2.0,comma
I have a command that I need to run in a Powershell script, the command is : ".\pacli DELETEUSER DESTUSER='"[email protected]`,com"' sessionid=333" | invoke-expression The comma (,) in here :[email protected],com is not a mistake, and that's what is giving me the hard time. I tried to escape the comma with `...

MatLab - Importing CSV text file that contains commas not meant to separate

matlab,csv,comma
Uh! I have received a delivery of very large text files with comma separated value format. I need to build a struct for each file for data analysis. Piece of cake! I have done this before. I quickly wrote some code to build the structs. Eventually, I discovered there can...

Turning results in comma separated list

sql,list,comma
I'm using this code to get the following resutls: Select [Doc #], [Production Number] From vwLiveDocuments Where [production number] IN ( SELECT [production number] FROM vwLiveDocuments where [tags] LIKE N'%name of tag%' Group by [production number] Having Count (*) > 1 ) I'll get the following results: 'Doc #' 'Production...

Regular Expression, 4th parameter

regex,parameters,notepad++,show,comma
I have some code, there is 7 parameters in each line. Each line is in parentheses and is ended with a semicolon. I need to take 2000 away from the 4th parameter of each line. Basically all I need to do is take off the first digit (2) off the...

android i want to replace second last comma with 'and'?

android,string,replace,comma
I want to remove the last comma from a string. I've tried doing this: int endIndex = frnd.lastIndexOf(","); if (endIndex != -1) { frnd = frnd.substring(0, endIndex); } and replacing the second last comma with 'and'...

Check variables and add them to comma separated list

jquery,list,comma
I have 4 javascript variables: a = 'first'; b = 'second'; c = 'third'; d = 'fourth'; What i want to achieve is to get them separated by comma, BUT. Sometimes where could be situations that some variables could be empty. Here is some of examples: EXAMPLE1: a = 'first';...

Pandas(Python) to_clipboard with comma decimal parameter

python,pandas,decimal,comma
How can I copy a DataFrame to_cliboard and paste it in excel with commas as decimal? In R this is simple. write.table(obj, 'clipboard', dec = ',') But I cannot figure out in pandas to_clipboard. I unsuccessfully tried changing: import locale locale.setlocale(locale.LC_ALL, '') Spanish_Argentina.1252 or df.to_clipboard(float_format = '%,%') Thanks in advance...

Can comma separated expressions be used as if statement in Javascript?

javascript,expression,comma
I'm trying to make sense of script which is makeing heavy use of comma-separated expressions. For example: popup_window != is_null && ("function" == typeof popup_window.close && popup_window.close(), popup_window = is_null); If it's true that comma separation means "evaluate all of the following expressions, then produce the value of the final...

MySQL - WHERE item IN commaSeperatedColumn

mysql,comma
How do you query to a comma separated value? In a table I have a column named colors it contains color-codes like this 1,5,8. How do i check whether, for example value 5, is within the comma separated column colors? Is this even possible to do with MySQL? ps: it...

Comma Automatically Being Added to TextField in Swift

swift,numbers,textfield,comma
I'm working on a status bar application. Currently all I have is a drop down menu that either quits the app or opens a preferences window. There is a textfield in the window that will be for a number value. While testing I noticed that when I used .orderOut to...

toLocaleString() doesn't work in Safari browser

jquery,safari,comma,money
I used toLocaleString() method to input money comma in `javascript. But the problem is, IE and chrome browser result correctly except Safari browser. I delete cache several times but still doesn't work. Can you help? ;) var test = 12300; console.log('test:'+test.toLocaleString()); // 12,300 in IE,Chrome // 12300 in Safari ...

adding commas to integers in C# [duplicate]

c#,int,comma,spacing
This question already has an answer here: .NET String.Format() to add commas in thousands place for a number 14 answers I'm trying to make a number guessing game that prints only to the console so far, problem is my knowledge and problem solving is in its infancy and I...

Awk & Sort-Output as Comma Delimited?

bash,shell,awk,comma,delimited
I am trying to get this to output as comma delimited. The current version doesn't work at all (I get a blank file as an output), and previous versions (where I keep the awk BEGIN statements but don't have the sort delimiter) will just output as tab delimited, not comma...

C comma in ternary statement

c,operator-keyword,ternary-operator,comma
int m = 5, d = 12, y = 1975, val; // May 12, 1975 Can someone please explain the function/purpose of the comma operator in the line of code below: val = (d+=m<3?y--:y-2,23*m/9+d+4+y/4-y/100+y/400)%7; The above line was written by Mike Keith to calculate the day of the week given...

Non nested for loops in a single line for creating list in python

python,list,comma
I am a novice in python. I wanted to create a list in a single line: >>> x = [[-1, y] for y in range(-1, 2), [0, 1], [1, z] for z in range(1, -2, -1), [0, -1]] to get : >>>> x = [[-1, -1], [-1, 0], [-1, 1],...

Java array concatenation using a comma?

java,arrays,comma
I've got a bit of a puzzle I need help to unravel here and I've been unable to find the answer here thus far ITL. In this file: https://bitcoinj.googlecode.com/git/core/src/main/java/com/google/bitcoin/core/PartialMerkleTree.java Appears the line: byte[] left = recursiveExtractHashes(height-1, pos*2, used, matchedHashes).getBytes(), right; Which eclipse seems to think is valid Java and it...

Comma separated list in database table, alternative?

sql,comma
I have a database table containing towns and cities used in a 'Places to visit' search. The town/city field is comma seperated. This is causing issues when people search for places such as Bradford, as it brings results for Bradford Upon Avon (it only brings up one result which is...

Turn comma seperated string into an array [duplicate]

jquery,arrays,split,comma
This question already has an answer here: Convert comma separated string to array 9 answers I get a string like this from the my multi-select(link) assetmasterfields=$('#assetmaster').multipleSelect("getSelects"); var arr = assetmasterfields.split(','); console.log(arr) This syntax gives me error: 'assetmasterfields.split is not a function' I would like to turn this into a...

How to remove specific numbers in a excel cell [closed]

excel,cell,comma
I have a single excel cell that contains the following data: 0.5 0.6, 0.3 0.4, 0.8 0.9 Is there a formula I can apply that removes everything from the cell that is not before the first comma and after the last comma. My wanted result would be the following: 0.5...

Import CSV File With Field Including Commas In Quotes?

php,sql,csv,comma,fgetcsv
I am importing the following data from a CSV file, whose formatting I have absolutely no control over: CampaignName,"""keyword""",441,11683,3.77%,2.99,112.82,"1,318.02",1.7,12,109.84 As you can see, one of the fields has a long number with a comma separator, though the value is enclosed in "..." The data is imported into SQL using the...

Sql Server select money with comma

sql-server,comma,money
I have Payment table in ms sql server. Payment table has below column type of money Salary Salary column has below values 1495.88 2235.08 719.59 15.75 9.59 0.00 NULL 97.77 When i select query as below, select Salary from Payment where Result must be below 1,495,88 2,235,08 719,59 15,75 9,59...

Regex Find last word between comma

regex,comma,between
I Have something like this : "my item1,item2,item3,item4," I just want as answer : "item4" I use this : (?<=\,).*(?=\,$) but it returns me : "item2,item3,item4" How I can get only the last ? I know that something with the lazy sign ? , but I'm not able to use...

Swift playground - How to convert a string with comma to a string with decimal

string,comma,swift-playground
I'm new in the Swift world. How can I converting a String with a comma to a String with a decimal? The code work's fine with a dot (.) The problem is when I'm using a comma (,) ... with: var price The origin of the problem is the Decimal...

Regex: How can I always get 'abc' from the following set of strings using regex:

regex,comma
Regex: How can I always get 'abc' from the following set of strings using regex: a> this is sample(abc) string b> this is sampleenter code here(abc, anything) string c> this is sample(abc, anything, can appear) string I have checked (([a-zA-Z]*)) , it worked for case (a) only when within bracket...

invalid arguments passed to implode

php,arguments,comma,implode
I am fetching some set of ids from database and want to print them comma separated using php implode() method. But it is giving me a warning that I passed invalid arguments to implode. So why do I get this warning and how can I fix my code, to get...

Combining multiple outputs from a loop into one text file with commas in Bash

bash,text,output,comma,multipleoutputs
I am testing out a method of motion detection using bash script. I am running an ImageMagick compare command and outputting the result into a text file. A loop creates one output every time it runs through. I want each output to be placed into a single text file and...

SQL Server insert number with commas

sql-server,insert,numbers,comma
I created a database table: I run this query INSERT INTO dbo.Stats (Date_of_Record, Rack_Code, Total_MB, Schools_MB, Percent_Schools, Central_MB, Percent_Central) VALUES (CAST(GETDATE() AS DATE), '78Q425', 45, 297, 1, 361, 0, 12, 0) and I get an error Msg 110, Level 15, State 1, Line 1 There are fewer columns in the...