Search Results

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

Page 12/36 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Objective C: Create arrays from first array based on value

    - by Nic Hubbard
    I have an array of strings that are comma separated such as: Steve Jobs,12,CA Fake Name,21,CA Test Name,22,CA Bill Gates,44,WA Bill Nye,21,OR I have those values in an NSScanner object so that I can loop through the values and get each comma seperated value using objectAtIndex. So, what I would like to do, is group the array items into new arrays, based on a value, in this case, State. So, from those, I need to loop through, checking which state they are in, and push those into a new array, one array per state. CA Array: Steve Jobs,12,CA Fake Name,21,CA Test Name,22,CA WA Array: Bill Gates,44,WA OR Array: Bill Nye,21,OR So in the end, I would have 3 new arrays, one for each state. Also, if there were additional states used in the first array, those should have new arrays created also. Any help would be appreciated!

    Read the article

  • How to Filter more than one field using WPF AutoCompleteBox

    - by Drew
    i am trying to customize the suggestions on the AutoCompleteBox in the WPF Tool kit. Right now i have a last name field which when the user enters characters a query runs that retrieves the top 10 records based on that last name. i would also like to filter by first name, i tried splitting out the comma and searching by the last name and the characters entered in the first name. however, as soon as a space or comma is entered into the autocompletebox, the suggest functionality stops working, which I believe is because the ValueMemberPath property is set to be last name. Is there a work around for this, or a way to modify the ValueMemberPath to handle multiple values? Thanks!

    Read the article

  • Exporting info from PS script to csv

    - by George
    Hi, This is a powershell/AD/Exchange question.... I'm running a script against a number of Users to check some of their attributes however I'm having trouble getting this to output to CSV. The script runs well and does exactly what I need it to do, the output on screen is fine, I'm just having trouble getting it to directly export to csv. The input is a comma seperated txt file of usernames (eg "username1,username2,username3") I've experimented with creating custom ps objects, adding to them and then exporting those but its not working.... Any suggestions gratefully received.. Thanks George $array = Get-Content $InputPath #split the comma delimited string into an array $arrayb = $array.Split(","); foreach ($User in $arrayb) { #find group memebership Write-Host "AD group membership for $User" Get-QADMemberOf $User #Get Mailbox Info Write-Host "Mailbox info for $User" Get-Mailbox $User | select ServerName, Database, EmailAddresses, PrimarySmtpAddress, WindowsEmailAddress #get profile details Write-Host "Home drive info for $User" Get-QADUser $User| select HomeDirectory,HomeDrive #add space between users Write-Host "" Write-Host "******************************************************" } Write-Host "End Script"

    Read the article

  • How to get the Output value of SP using C#

    - by karthik
    I am using the following Code to execute the SP of MySql and get the output value. I need to get the output value to my c# after SP is executed. How ? Thanks. Code : public static string GetInsertStatement(string DBName, string TblName, string ColName, string ColValue) { string strData = ""; MySqlConnection conn = new MySqlConnection(ConfigurationSettings.AppSettings["Con_Admin"]); MySqlCommand cmd = conn.CreateCommand(); try { cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.CommandText = "InsGen"; cmd.Parameters.Clear(); cmd.Parameters.Add("in_db", MySqlDbType.VarChar, 20); cmd.Parameters["in_db"].Value = DBName; cmd.Parameters.Add("in_table", MySqlDbType.VarChar, 20); cmd.Parameters["in_table"].Value = TblName; cmd.Parameters.Add("in_ColumnName", MySqlDbType.VarChar, 20); cmd.Parameters["in_ColumnName"].Value = ColName; cmd.Parameters.Add("in_ColumnValue", MySqlDbType.VarChar, 20); cmd.Parameters["in_ColumnValue"].Value = ColValue; conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); } catch (System.Exception e) { Console.WriteLine(e.Message); } return strData; } SP : DELIMITER $$ DROP PROCEDURE IF EXISTS `InsGen` $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `InsGen` ( in_db varchar(20), in_table varchar(20), in_ColumnName varchar(20), in_ColumnValue varchar(20) ) BEGIN declare Whrs varchar(500); declare Sels varchar(500); declare Inserts varchar(2000); declare tablename varchar(20); declare ColName varchar(20); set tablename=in_table; # Comma separated column names - used for Select select group_concat(concat('concat(\'"\',','ifnull(',column_name,','''')',',\'"\')')) INTO @Sels from information_schema.columns where table_schema=in_db and table_name=tablename; # Comma separated column names - used for Group By select group_concat('`',column_name,'`') INTO @Whrs from information_schema.columns where table_schema=in_db and table_name=tablename; #Main Select Statement for fetching comma separated table values set @Inserts=concat("select concat('insert into ", in_db,".",tablename," values(',concat_ws(',',",@Sels,"),');') from ", in_db,".",tablename, " where ", in_ColumnName, " = " , in_ColumnValue, " group by ",@Whrs, ";"); PREPARE Inserts FROM @Inserts; select Inserts; EXECUTE Inserts; END $$ DELIMITER ;

    Read the article

  • IE 8 Caching Problem

    - by Jeff Catania
    One of my javascript sources had an extra comma that was throwing an error in IE8. So I opened up my editor, deleted the comma, and saved. I reloaded IE8, but it was still pulling the old js file. I deleted everything in "Delete Browsing History...", and restarted the browser. It is still pulling the old file. I even set up a log on my server to show whenever the js file was requested. When reloading with IE, the js file is never requested. I tried doing the same process in Chrome and FF, and it pulled the new file and logged properly on the server. Is there some other cache that I am failing to clear in IE that would cause this problem?

    Read the article

  • Converting delimited string to multiple values in mysql

    - by epo
    I have a mysql legacy table which contains an client identifier and a list of items, the latter as a comma-delimited string. E.g. "xyz001", "foo,bar,baz". This is legacy stuff and the user insists on being able to edit a comma delimited string. They now have a requirement for a report table with the above broken into separate rows, e.g. "xyz001", "foo" "xyz001", "bar" "xyz001", "baz" Breaking the string into substrings is easily doable and I have written a procedure to do this by creating a separate table, but that requires triggers to deal with deletes, updates and inserts. This query is required rarely (say once a month) but has to be absolutely up to date when it is run, so e.g. the overhead of triggers is not warranted and scheduled tasks to create the table might not be timely enough. Is there any way to write a function to return a table or a set so that I can join the identifier with the individual items on demand?

    Read the article

  • Parsing a DateTime containing milliseconds fails for certain cultures. Why?

    - by dradovic
    I'm trying to parse a string containing milliseconds like this: string s = "11.05.2010 15:03:08.7718687"; // culture: de-CH DateTime d = DateTime.Parse(s); // works However, for example under the de-DE locale, the decimal separator is a comma (not a dot). So the example becomes: string s = "11.05.2010 15:03:08,7718687"; // culture: de-DE (note the comma) DateTime d = DateTime.Parse(s); // throws a FormatException It is weird to me that DateTime.Parse(s) should throw a FormatException now as it is supposed to use the CultureInfo.CurrentCulture to do the parsing. Even passing the CurrentCulture as an argument explicitly does not help neither. Does anybody have an idea why this does not work? Doesn't parsing take the NumberFormatInfo.NumberDecimalSeparator into account?

    Read the article

  • How do you set the "global delimiter" in Excel using VBA?

    - by DanM
    I've noticed that if I use the text-to-columns feature with comma as the delimiter, any comma-delimited data I paste into Excel after that will be automatically split into columns. This makes me think Excel must have some kind of global delimiter. If this is true, how would I set this global delimiter using Excel VBA? Is it possible to do this directly, or do I need to "trick" Excel by doing a text-to-columns on some junk data, then delete the data? My ultimate goal is to be able to paste in a bunch of data from different files using a macro, and have Excel automatically split it into columns according to the delimiter I set.

    Read the article

  • SQL Split function.

    - by Wardy
    Hi guys, I'm looking for a way to do this ... SELECT FirstName, LastName, Split(AddressBlock, ' ', 1), Split(AddressBlock, ' ', 2), PostCode FROM Contacts The arguments I want to pass are ... The address The separator (current situation requires 2 spaces but this might be a comma or a space followed by a comma) or something else (it varies). The address part I want to return (i don't always need all parts of the split result). I seem to be able to find a few examples of splitting functions about the internet but they return a table containing the entire set of split parts. My SQL skills aren't that great so I need the answer to be ultra simple. I'm always working with nvarchar data and the function needs to be reusable.

    Read the article

  • C# Problem with keyboard language...

    - by user300484
    Hello you all! I just made an application which purpose is to find an x result using the rule of three. It runs fine and everything but there is a small problem. I am using WinXP Europpean Spanish version. As we all know, in many europpean countries the decimal dot is changed by a " , " comma. When I use my application, it turns out that when I press the dot key on my keyboard´s number pad, my application doesnt take it as a normal decimal dot and it ignores it... so I need to manually press the comma key so it can give me the right answer. How can I solve this problem?

    Read the article

  • Optimal way to generate list of PHP object properties with delimiter character, implode()?

    - by Kris
    I am trying to find out if there is a more optimal way for creating a list of an object's sub object's properties. (Apologies for the crude wording, I am not really much of an OO expert) I have an object "event" that has a collection of "artists", each artist having an "artist_name". On my HTML output, I want a plain list of artist names delimited by a comma. PHP's implode() seems to be the best way to create a comma delimited list of values. I am currently iterating through the object and push values in a temporary array "artistlist" so I can use implode(). That is the shortest I could come up with. Is there a way to do this more elegant? $artistlist = array(); foreach ($event->artists as $artist) { $artistlist[] = $artist->artist_name; } echo implode(', ', $artistlist);

    Read the article

  • How do you set the "global delimiter" in Excel using VBA (or unicorns)?

    - by DanM
    I've noticed that if I use the text-to-columns feature with comma as the delimiter, any comma-delimited data I paste into Excel after that will be automatically split into columns. This makes me think Excel must have some kind of global delimiter. If this is true, how would I set this global delimiter using Excel VBA? Is it possible to do this directly, or do I need to "trick" Excel by doing a text-to-columns on some junk data, then delete the data? My ultimate goal is to be able to paste in a bunch of data from different files using a macro, and have Excel automatically split it into columns according to the delimiter I set.

    Read the article

  • Displaying list of objects as single column in a bound gridview (Winforms)?

    - by Carrie Nelson
    I have a gridview that is bound to a datasource on a Windows Form (VB.NET). The grid displays a list of "certifications", and each "certification" can be associated with many languages. So in the grid, I'd like to display "languages" as a column, and display a comma delimited list of the language names for each "certification". In the "certification" class, one of the properties is a list of "language" objects, and each "language" has an ID (guid), name (string), and value (integer). So in the datasource, I have the list of "languages", but I can't figure out how to display them in a column on the grid. The gridview won't let me add the language list property as a column. So is the ONLY way to add a new property on the "certification" class, which returns a string that contains the comma delimited list, and show THAT on the grid? Or is there a way to display that list of "languages"?

    Read the article

  • Problem with keyboard language

    - by user300484
    Hello you all! I just made an application which purpose is to find an x result using the rule of three. It runs fine and everything but there is a small problem. I am using WinXP Europpean Spanish version. As we all know, in many europpean countries the decimal dot is changed by a " , " comma. When I use my application, it turns out that when I press the dot key on my keyboard´s number pad, my application doesnt take it as a normal decimal dot and it ignores it... so I need to manually press the comma key so it can give me the right answer. How can I solve this problem?

    Read the article

  • File processing-Haskell

    - by Martinas Maria
    How can I implement in haskell the following: I receive an input file from the command line. This input file contains words separated with tabs,new lines and spaces.I have two replace this elements(tabs,new lines and spaces) with comma(,) .Observation:more newlines,tabs,spaces will be replaced with a single comma.The result has to be write in a new file(output.txt). Please help me with this.My haskell skills are very scarse. This is what I have so far: processFile::String->String processFile [] =[] processFile input =input process :: String -> IO String process fileName = do text <- readFile fileName return (processFile text) main :: IO () main = do n <- process "input.txt" print n In processFile function I should process the text from the input file. I'm stuck..Please help.

    Read the article

  • Fire only one Custom Validator at a time

    - by Lijo
    I have two Custom Validators attached to a textbox. The textbox is to enter comma separated list of emails. The first validator checks that there is not duplicate email address. The second custom validator checks that all the email addresses are in valid format. I have following code and it works fine. However, when both the failure criteria is met both of them are firing and I get two * at the right side of my textbox. What is the best approach to show only one * at a time? CODE <asp:CustomValidator ID="valEmailRecipients" runat="server" ControlToValidate="txtEmailRecipients" ClientValidationFunction="isUniqueElements" OnServerValidate="IsUniqueEmail_Validate" Text="*" ErrorMessage="There should be no duplicate email address for a report" ValidationGroup="Save"> </asp:CustomValidator> <asp:CustomValidator ID="valEmailFormat" runat="server" ControlToValidate="txtEmailRecipients" ClientValidationFunction="checkEmailFormat" OnServerValidate="IsValidEmailFormat_Validate" Text="*" ErrorMessage="Entries should be valid email addresses separated by comma" ValidationGroup="Save"> </asp:CustomValidator> REFERENCES: Validating with a Custom Function for ASP.NET Server Controls

    Read the article

  • Detecting regional settings (List Separator) from web

    - by Toms Mikoss
    After having the unpleasant surprise that Comma Seperated Value (CSV) files are not necessarily comma-separated, I'm trying to find out if there is any way to detect what the regional settings list separator value is on the client machine from http request. Scenario is as follows: A user can download some data in CSV format from web site (RoR, if it matters). That CSV file is generated on the fly, sent to the user, and most of the time double-clicked and opened in MS Excel on Windows machine at the destination. Now, if the user has ',' set as the list separator, the data is properly arranged in columns, but if any other separator (';' is widely used here) is set, it all just gets thrown into a single column. So, is there any way to detect what separator is used on the client machine, and generate the file accordingly? I have a sinking feeling that it is not, but I'd like to be sure before I pass the 'can't be done, sorry' line to the customer :)

    Read the article

  • Left Join works with table but fails with query

    - by Frank Martin
    The following left join query in MS Access 2007 SELECT Table1.Field_A, Table1.Field_B, qry_Table2_Combined.Field_A, qry_Table2_Combined.Field_B, qry_Table2_Combined.Combined_Field FROM Table1 LEFT JOIN qry_Table2_Combined ON (Table1.Field_A = qry_Table2_Combined.Field_A) AND (Table1.Field_B = qry_Table2_Combined.Field_B); is expected by me to return this result: +--------+---------+---------+---------+----------------+ |Field_A | Field_B | Field_A | Field_B | Combined_Field | +--------+---------+---------+---------+----------------+ |1 | | | | | +--------+---------+---------+---------+----------------+ |1 | | | | | +--------+---------+---------+---------+----------------+ |2 |1 |2 |1 |John, Doe | +--------+---------+---------+---------+----------------+ |2 |2 | | | | +--------+---------+---------+---------+----------------+ [Table1] has 4 records, [qry_Table2_Combined] has 1 record. But it gives me this: +--------+---------+---------+---------+----------------+ |Field_A | Field_B | Field_A | Field_B | Combined_Field | +--------+---------+---------+---------+----------------+ |2 |1 |2 |1 |John, Doe | +--------+---------+---------+---------+----------------+ |2 |2 |2 | |, | +--------+---------+---------+---------+----------------+ Really weird is that the [Combined_Field] has a comma in the second row. I use a comma to concatenate two fields in [qry_Table2_Combined]. If the left join query uses a table created from the query [qry_Table2_Combined] it works as expected. Why does this left join query not give the same result for a query and a table? And how can i get the right results using a query in the left join?

    Read the article

  • Why won't this compile and how can it be implemented so that it does?

    - by George Edison
    Here is some C++ code I'm playing around with: #include <iostream> #include <vector> #define IN , #define FOREACH(x,y) for(unsigned int i=0;i<y.size();i++) { x=y[i]; #define ENDFOREACH } using namespace std; int main() { vector<int> ints; ints.push_back(3); ints.push_back(4); ints.push_back(5); ints.push_back(6); FOREACH(int item IN ints) cout << item; ENDFOREACH return 0; } However, I get an error: macro "FOREACH" requires 2 arguments, but only 1 given The code compiles if I change the IN to a comma. How can I get the IN to take the place of a comma?

    Read the article

  • Why do spaces appear in my string?

    - by Abs
    Hello all, I have this function below which returns all IDs of checked boxes on my page seperated by a comma. It works great but the problem is, it seems to put a lot of white space after each checkbox ID. I can't seem to figure out why? /*Returns selected checkbox ID in string seperated by comma */ function get_selected_chkbox(){ var checked_string = ''; $('#report_table').find("input[type='checkbox']").each(function(){ if(this.checked){ checked_string = checked_string + this.id + ','; } }); alert(checked_string);//test1 ,test2 , return checked_string; } Thanks all for any help

    Read the article

  • read text file line by line and insert/update values in table

    - by I__
    i am exploring the option of whether DoCmd.TransferText will do what i need, and it seems like it wont. i need to insert data if it does not exist and update it if it does exist i am planning to read a text file line by line like this: Dim intFile As Integer Dim strLine As String intFile = FreeFile() Open myFile For Input As #intFile Line Input #intFile, strLine Close #intFile i guess each individual line will be a record. it will probably be comma separated and some fields will have a " text qualifier because within the field itself i will have commas my question is how would i read a comma delimited text file that has double quotes sometimes as text qualifiers into a table in access?

    Read the article

  • Converting delimited string to multiple values in mysql

    - by epo
    I have a mysql legacy table which contains an client identifier and a list of items, the latter as a comma-delimited string. E.g. "xyz001", "foo,bar,baz". This is legacy stuff and the user insists on being able to edit a comma delimited string. They now have a requirement for a report table with the above broken into separate rows, e.g. "xyz001", "foo" "xyz001", "bar" "xyz001", "baz" Breaking the string into substrings is easily doable and I have written a procedure to do this by creating a separate table, but that requires triggers to deal with deletes, updates and inserts. This query is required rarely (say once a month) but has to be absolutely up to date when it is run, so e.g. the overhead of triggers is not warranted and scheduled tasks to create the table might not be timely enough. Is there any way to write a function to return a table or a set so that I can join the identifier with the individual items on demand?

    Read the article

  • Why is this code generating extra commas?

    - by user816829
    Iam using javascript function chkout_pp(i) { var myarray = new Array(); var li = 1; myarray[0] = "" for(j = 1; j < 13; j++) { if ($('#chkpp'+j).is(':checked') == true) { myarray[li] = $('#chkpp'+j).val()+"<br>"; li++; } } $("#ownerarray").val(myarray); $("#edmt_pp").html(myarray+""); } this is javascript in this it is generating comma i want to remove comma from that,is their anyone can as\nswer my question

    Read the article

  • SQL change "like" to "contains"

    - by Paul
    products table (mySQL) record_id categories (comma-delimited list) --------- -------------------------------- 1 960|1,957|1,958|1 I have the following dynamic query (simplified for the purposes of this question). The query is passed specified categories, each in the format xxxx|yyyy, and I need to return products having the passed category in its comma-delimited list of categories. The current query looks like: select p.* from products p where (p.categories like '%27|0%' or p.categories like '%972|1%' or p.categories like '%969|1%') But, the LIKE clause sometimes permits anomalies. I would like to write the query more like: select p.* from products p where (p.categories contains '27|0' or p.categories contains'972|1' or p.categories contains '969|1') How would I do this?

    Read the article

  • Problems reading text file data in Java

    - by user1828401
    I have this code: BufferedReader br =new BufferedReader(new FileReader("userdetails.txt")); String str; ArrayList<String> stringList = new ArrayList<String>(); while ((str=br.readLine())!=null){ String datavalue [] = str.split(","); String category = datavalue[0]; String value = datavalue[1]; stringList.add(category); stringList.add(value); } br.close(); it works when the variables category and value do not have a comma(,),however the values in the variable value does contain commas.Is there a way that I can split the index of the without using comma?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >