Search Results

Search found 891 results on 36 pages for 'comma'.

Page 6/36 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • php add thousandseperator without adjusting comma

    - by bobwah
    I'm looking for a way to use the php number_format function or something similar that will add the thousand seperator but will leave any decimal part of the number intatct without and formatting of this. For example: 39845.25843 = 39,845.25843 347346.8 = 347,346.8 1000000 = 1,000,000 Thanks

    Read the article

  • Finding comma separated values with a colon delimiter

    - by iconMatrix
    I am setting values in my database for tourneyID,Selected,Paid,Entered,date then separating each selection with a colon So I have a string that may look like this 187,S,,,09-21-2013:141,S,,,06-21-2013:144,S,,,05-24-2013 but it also could look like this 145,S,,,07-12-2013:142,S,,,05-24-2013:187,S,,,09-21-2013 and some times is looks like this 87,S,,,07-11-2013:125,S,,,06-14-2013 I am trying to find this sequence: 187,S,,,09-21-2013 I have data stored like that because I paid a programmer to code it for me. Now, as I learn, I see it was not the best solution, but it is what I have till I learn more and it is working. My problem is when using LIKE it returns both the 187 and 87 values $getTeams = mysql_query("SELECT * FROM teams WHERE (team_tourney_vector LIKE '%$tid,S,P,,$tourney_start_date%' OR team_tourney_vector LIKE '%$tid,S,,,$tourney_start_date%') AND division='$division'"); I tried this using FIND_IN_SET() but it would only return the the team id for this string 187,S,,,09-21-2013:141,S,,,06-21-2013:144,S,,,05-24-2013 and does not find the team id for this string 145,S,,,07-12-2013:142,S,,,05-24-2013:187,S,,,09-21-2013 SELECT * FROM teams WHERE FIND_IN_SET('187',team_tourney_vector) AND (team_tourney_vector LIKE '%S,,,09-21-2013%') Any thoughts on how to achieve this?

    Read the article

  • Build comma seperated string from the struct in C#

    - by acadia
    Hello, I have the following struct in C# class public struct Employee { public const string EMPID = "EMP_ID"; public const string FName = "FIRST_NAME"; public const string LNAME = "LAST_NAME"; public const string DEPTID = "DEPT_ID"; } Is there an easy way to build a string as follows const string mainquery="INSERT INTO EMP(EMP_ID,FIRST_NAME,LAST_NAME,DEPT_ID) VALUES(:EMP_ID,:FIRST_NAME,:LAST_NAME,:DEPT_ID)" Instead of doing as follows and then concatenating it. const string EMP_COLS= EMPLOYEE.EMPID + "," + EMPLOYEE.FNAME + "," + EMPLOYEE.LNAME + "," + EMPLOYEE.DEPTID; const string EMP_Values= EMPLOYEE.EMPID + ":" + EMPLOYEE.FNAME + ":" + EMPLOYEE.LNAME + ":" + EMPLOYEE.DEPTID;

    Read the article

  • reading into table: comma values and quotes SQL

    - by every_answer_gets_a_point
    i have a string like this something = "something, something1, "something2, something else", something3" i need it to be read into a table like this: field1 = "something" field2= "something2" field3 = "something2, something else" field4 = "something3" please notice that the double quotes in the something string signified that the string inside the quotes is to be placed in one field anyone know how to do this with an insert into statement or some other way? the answer can be purely sql or can be vba with sql. thanks!

    Read the article

  • Export to csv in jQuery

    - by Rahul Joshi
    I am dynamically generating a div which is like : <div id='PrintDiv'> <table id="mainTable"> <tr> <td> Col1 </td> <td> Col2 </td> <td> Col3 </td> </tr> <tr> <td> Val1 </td> <td> Val2 </td> <td> Val3 </td> </tr> <tr> <td> Val11 </td> <td> Val22 </td> <td> Val33 </td> </tr> <tr> <td> Val111 </td> <td> Val222 </td> <td> Val333 </td> </tr> </table> </div> And there are lot more elements on the page as well. Now, how can i get a csv file like this : Col1,Col2,Col3 Val1,Val2,Val3 Val11,Val22,Val33 Val111,Val222,Val333 using jQuery ? need a file save dailog box too,like this : Thanks.

    Read the article

  • C++ -- return x,y; The point?

    - by Earlz
    Hello, I have been programming in C and C++ for a few years and now I'm taking a college course in it and our book had a function like this int foo(){ int x=0; int y=20; return x,y; //y is always returned } I have never seen such syntax. In fact, I never see the , operator used outside of parameter lists. If y is always returned though, then what is the point? Is there a case where a return statement would need to be created like this? (Also, I tagged C as well because it applies to both, though my book specifically is C++)

    Read the article

  • Better than dynamic SQL - How to pass a list of comma separated IDs into a stored proc

    - by Rodney Vinyard
    Better than dynamic SQL - How to pass a list of comma separated IDs into a stored proc:     Derived form "Method 6" from a great article: ·         How to pass a list of values or array to SQL Server stored procedure ·          http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm     Create PROCEDURE [dbo].[GetMyTable_ListByCommaSepReqIds] (@CommaSepReqIds varchar(500))   AS   BEGIN   select * from MyTable q               JOIN               dbo.SplitStringToNumberTable(@CommaSepReqIds) AS s               ON               q.MyTableId = s.ID End     ALTER FUNCTION [dbo].[SplitStringToNumberTable] (        @commaSeparatedList varchar(500) ) RETURNS @outTable table (        ID int ) AS BEGIN        DECLARE @parsedItem varchar(10), @Pos int          SET @commaSeparatedList = LTRIM(RTRIM(@commaSeparatedList))+ ','        SET @commaSeparatedList = REPLACE(@commaSeparatedList, ' ', '')        SET @Pos = CHARINDEX(',', @commaSeparatedList, 1)          IF REPLACE(@commaSeparatedList, ',', '') <> ''        BEGIN               WHILE @Pos > 0               BEGIN                      SET @parsedItem = LTRIM(RTRIM(LEFT(@commaSeparatedList, @Pos - 1)))                      IF @parsedItem <> ''                            BEGIN                                   INSERT INTO @outTable (ID)                                   VALUES (CAST(@parsedItem AS int)) --Use Appropriate conversion                            END                            SET @commaSeparatedList = RIGHT(@commaSeparatedList, LEN(@commaSeparatedList) - @Pos)                            SET @Pos = CHARINDEX(',', @commaSeparatedList, 1)               END        END           RETURN END

    Read the article

  • Why do node packages put a comma on a newline?

    - by SomeKittens
    I'm learning node.js and am trying out Express. My first app had this code: var express = require('express') , routes = require('./routes') , user = require('./routes/user') , http = require('http') , path = require('path'); Reading through the mongoose tutorial gives me this: var mongoose = require('mongoose') , db = mongoose.createConnection('localhost', 'test'); On strict mode, JSHint gives me app.js: line 6, col 32, Bad line breaking before ','. Which shows that I'm not the only one out there who's bugged by this syntax. Is there any reason to declare vars this way instead of adding the comma at the end of the line?

    Read the article

  • Regex for removing an item from a comma-separated string?

    - by ingredient_15939
    Say I have a string like this: "1,2,3,11" A simple regex like this will find a number in the string: (?<=^|,)1(?=,|$) - this will correctly find the "1" (ie. not the first "1" in "11"). However, to remove a number from the string, leaving the string properly formatted with commas in between each number, I need to include one adjacent comma only. For example, matching 1,, 2, or ,11. So the trick is to match one comma, on either side of the number, but to ignore the comma on the opposite side (if there is one). Can someone help me with this?

    Read the article

  • Windows Server wbadmin recover with commas

    - by dlp
    I want to do a recovery of files with commas in their names from the command line, ala: wbadmin start recovery -version:10/01/2013-12:00 -itemType:File -overwite:Overwrite -quiet "-Items:C:\Path\To\File, With Comma.txt,C:\Path\To\File 2, With Comma.txt" So there are two files: C:\Path\To\File, With Comma.txt C:\Path\To\File 2, With Comma.txt The problem is wbadmin assumes commas separates each file, so it sees 4 files specified instead of 2. I've tried putting a \ in front of commas that are part of the file names like so: wbadmin start recovery -version:10/01/2013-12:00 -itemType:File -overwite:Overwrite -quiet "-Items:C:\Path\To\File\, With Comma.txt,C:\Path\To\File 2\, With Comma.txt" but it doesn't work, it just says there's a syntax error. The documentation on Technet doesn't seem to mention anything that'll help either. OS is Windows Server 2008 R2. A clarifying comment: I've changed the file names to be different than the actual names to be less revealing, but I also see I dumbed it down too much. The comma can occur either in the file name itself like C:\Path\To\File, With Comma.txt' or in the path to the file, like:C:\Path, To\Other\File.txt`.

    Read the article

  • regexp to match string with (comma-separated) number at start and to split into number and rest?

    - by mix
    Given a string such as: 23,234,456 first second third How can I split string this into two parts, where part 1 contains the number at the beginning and part 2 contains the rest---but only if the string STARTS with a number, and the number can be comma-separated or not? In other words, I want two results: 23,234,456 and first second third. If there's a number in that string that isn't part of the first number then it should be in the second result. My best stab at this so far, to grab the number at the beginning, is something like this: ^[0-9]+(,[0-9]{3})* Which seems to grab a comma-separated or non-comma-separated number that starts the line. However, when I run this in the Javascript console I get not only the full number, but also a match on just the last 3 digits with their preceeding ,. (e.g. 23,234,456 and ,456). As for getting the rest into another var I'm having trouble. I tried working with \b, etc., but I think I must be missing something fundamental about grabbing the rest of the line. I'm doing this in Javascript in case it matters. More examples of what to match and what not to match. 2 one two three should return 2 and one two three 2345 one two three should return 2345 and one two three 2 one 2 three should return 2 and one 2 three 2,234 one two 3,000 should return 2,234 and one two 3,000 The space between parts 1 and two could be included in the beginning of part 2.

    Read the article

  • A regex to match a comma that isn't surrounded by quotes.

    - by Rayne
    I'm using Clojure, so this is in the context of Java regexes. Here is an example string: "{:a "ab,cd, efg", :b "ab,def, egf,", :c "Conjecture"}" The important bits are the commas after each string. I'd like to be able to replace them with newline characters with Java's replaceAll method. A regex that will match any comma that is not surrounded by quotes will do. If I'm not coming across well, please ask and I'll be happily to clarify anything. edit: sorry for the confusion in the title. I haven't been awake very long. String: {:a "ab, cd efg",} <-- In this example, the comma at the end would be matched, but the ones inside the quote would not.

    Read the article

  • From comma separated list to individual item result set. *mysql

    - by Raziel
    I'm doing some data migration from a horribly designed database to a less horribly designed database. There is a many to many relationship that has a primary key in one table that corresponds to a comma separated list in another. FK_ID | data ------------- 1,2 | foo 3 | bar 1,3,2 | blarg Is there a way to output the FK_ID field with each comma separated element as a single line in the result set? result set FK_ID | data ------------- 1 | foo 2 | foo 3 | bar 1 | blarg 2 | blarg 3 | blarg I'm thinking this would require some sort of recursive query which I don't think mysql has. Thanks in advance.

    Read the article

  • How can I read a comma delimited text file in a Windows batch file?

    - by Sms
    I can get it to read the text file until it becomes a comma delimited text file. I would like to read the two variables on each line and test each one with a If statement for another condition. Problem is I can't read the variables properly. Tried many things but here is what I will post. Timeouts are to see what's happening: for /f "tokens=*" %%a in (TestText.txt) do ( timeout /t 1 echo %%a is the present variabe timeout /t 2 if %%a=="One","1" echo Match for "One","1" timeout /t 3 if %%a=="One""1" echo Match for "One","1" timeout /t 4 if %%a=="One" echo Match for "One" timeout /t 5 if %%a=="1" echo Match for "1" timeout /t 6 ) TestText.txt "One","1" "Two","2" "Three","3" "Four","4" OUTPUT: "One","1" is the present variabe

    Read the article

  • How to reference or vlookup a list of values based on a comma separated list of column references within a cell in excel?

    - by glallen
    I want to do a vlookup (or similar) against a column which is a list of values. This works fine for looking up a value from a single row, but I want to be able to look up multiple rows, sum the results, and divide by the number of rows referenced. For example: A B C D E F G [----given values----------------] [Work/Auth] [sum(vlookup(each(G),table,5)) /count(G)] [given vals] 1 Item Authorized OnHand Working Operational% DependencyOR% Dependencies 2 A 1 1 1 1 .55 B 3 B 10 5 5 .50 .55 C,D 4 C 100 75 50 .50 .60 D 5 D 10 10 6 .60 1 I want to be able to show an Operational Rate, and an operational rate of the systems each system depends on (F). In order to get a value for F, I want to sum over each value in column-E that was referenced by a dependency in column-G then divide by the number of dependencies in G. Column-G can have varying lengths, and will be a comma separated list of values from column-A. Is there any way to do this in excel?

    Read the article

  • convert xml document to comma delimited (CSV) file using xslt stylesheet.

    - by Brad H
    I need some assistance converting an xml document to a CSV file using an xslt stylesheet. I am trying to use the following xsl and I can't seem to get it right. I want my comma delimited file to include column headings, followed by the data. My biggest issues are removing the final comma after the last item and inserting a carriage return so each group of data appears on a separate line. I have been using XML Notepad. <xsl:template match="/"> <xsl:element name="table"> <xsl:apply-templates select="/*/*[1]" mode="header" /> <xsl:apply-templates select="/*/*" mode="row" /> </xsl:element> </xsl:template> <xsl:template match="*" mode="header"> <xsl:element name="tr"> <xsl:apply-templates select="./*" mode="column" /> </xsl:element> </xsl:template> <xsl:template match="*" mode="row"> <xsl:element name="tr"> <xsl:apply-templates select="./*" mode="node" /> </xsl:element> </xsl:template> <xsl:template match="*" mode="column"> <xsl:element name="th"> <xsl:value-of select="translate(name(.),'qwertyuiopasdfghjklzxcvbnm_','QWERTYUIOPASDFGHJKLZXCVBNM ')" /> </xsl:element>, </xsl:template> <xsl:template match="*" mode="node"> <xsl:element name="td"> <xsl:value-of select="." /> </xsl:element>, </xsl:template>

    Read the article

  • How to show numbers with comma separation in flex?

    - by zombiegx
    I can't seem to find anything that would let me to easily show a Number in a label, textinput, etc. with comma separation. like in a label, show number 123456.78 as 123,456.78 [Bindable] private var num:Number = 123456.78; <mx:Label text={num} /> Obviously I could just create a function, but is there a more simple way? thanks

    Read the article

  • How to separate comma separeted data from csv file?

    - by Rahul
    I have opened a csv file and I want to sort each string which is comma separeted and are in same line: ex:: file : name,sal,dept tom,10000,it o/p :: each string in string variable I have a file which is already open, so I can not use "open" API, I have to use "csv.reader" which have to read one line at a time.

    Read the article

  • Best way to check for string in comma-delimited list with .NET?

    - by Jeremy Stein
    I'm reading a comma-delimited list of strings from a config file. I need to check whether another string is in that list. For example: "apple,banana,cheese" If I check for "apple" I should find it, but if I check for "app" I should not. What's the most straight-forward and concise way to do this? It doesn't have to be fast. (I'll add my solution as an answer, but I'm hoping someone has something better.)

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >