Search Results

Search found 1839 results on 74 pages for 'comma separated'.

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

  • Linq query with subquery as comma-separated values

    - by Keith
    In my application, a company can have many employees and each employee may have have multiple email addresses. The database schema relates the tables like this: Company - CompanyEmployeeXref - Employee - EmployeeAddressXref - Email I am using Entity Framework and I want to create a LINQ query that returns the name of the company and a comma-separated list of it's employee's email addresses. Here is the query I am attempting: from c in Company join ex in CompanyEmployeeXref on c.Id equals ex.CompanyId join e in Employee on ex.EmployeeId equals e.Id join ax in EmployeeAddressXref on e.Id equals ax.EmployeeId join a in Address on ax.AddressId equals a.Id select new { c.Name, a.Email.Aggregate(x=x + ",") } Desired Output: "Company1", "[email protected],[email protected],[email protected]" "Company2", "[email protected],[email protected],[email protected]" ... I know this code is wrong, I think I'm missing a group by, but it illustrates the point. I'm not sure of the syntax. Is this even possible? Thanks for any help.

    Read the article

  • Grouping string by comma between brackets

    - by Myra
    Response to : http://stackoverflow.com/questions/1454913/regular-expression-to-find-a-string-included-between-two-characters-while-exclud Hi,I'm looking for a regex pattern that applies to my string including brackets: [1,2,3,4,5] [abc,ef,g] [0,2,4b,y7] could be anything including word,digit,non-word together or separated. I wish to get the group between brackets by \[(.*?)\] but what is the regex pattern that will give me the group between brackets and sub-group strings separated by commas so that the result may be following ?? Group1 : [1,2,3,4,5] Group1: 1 Group2: 2 Group3: 3 Group4: 4 Group5: 5 Group2 : [abc,ef,g] Group1: abc Group2: ef Group3: g etc .. Thank you for your help

    Read the article

  • Parsing a comma-separated list

    - by alex
    I have a comma-separated list of values, for example: strins s = "param1=true;param2=4;param3=2.0f;param4=sometext;"; I need a functions: public bool ExtractBool(string parameterName, string @params); public int ExtractInt(string parameterName, string @params); public float ExtractFloat(string parameterName, string @params); public string ExtractString(string parameterName, string @params); Is there a special functions in .net that can help me with csl ? PS: parameter names are equal within a list.

    Read the article

  • MySQL Join Comma Separated Field

    - by neeraj
    I have two tables. First Table is a batch table that contain comma separated student id in field "batch" batch -------------- id batch -------------- 1 1,2 2 3,4 Second Table is marks marks ---------------------- id studentid subject marks 1 1 English 50 2 2 English 40 3 3 English 70 4 1 Math 65 5 4 English 66 6 5 English 75 7 2 Math 55 How we can find those students of first batch id =1 who have scored more than 45 marks in English without using sub query. Problem i found to get this done using a single query is that we can not use IN as an association operator in JOIN statement What changes are required in below query to make it work? SELECT * FROM batch INNER JOIN marks ON marks.studentid IN(batch.batch) where batch.id = 1

    Read the article

  • Comma separated values in a database field

    - by John Doe
    I have a products table. Each row in that table corresponds to a single product and it's identified by a unique Id. Now each product can have multiple "codes" associated with that product. For example: Id | Code ---------------------- 0001 | IN,ON,ME,OH 0002 | ON,VI,AC,ZO 0003 | QA,PS,OO,ME What I'm trying to do is create a stored procedure so that I can pass in a codes like "ON,ME" and have it return every product that contains the "ON" or "ME" code. Since the codes are comma separated, I don't know how I can split those and search them. Is this possible using only TSQL? Edit: It's a mission critical table. I don't have the authority to change it.

    Read the article

  • Separating null byte separated UNICODE C string.

    - by Ramblingwood
    First off, this is NOT a duplicate of: http://stackoverflow.com/questions/1911053/turn-a-c-string-with-null-bytes-into-a-char-array , because the given answer doesn't work when the char *'s are Unicode. I think the problem is that because I am trying to use Unicode and thus wchar_t instead of char, the length of each character is different and thus, this doesn't work (it does in non-unicode): char *Buffer; // your null-separated strings char *Current; // Pointer to the current string // [...] for (Current = Buffer; *Current; Current += strlen(Current) + 1) printf("GetOpenFileName returned: %s\n", Current); Does anyone have a similar solution that works on Unicode strings? I have been banging my head on the this for over 4 hours now. C doesn't agree with me.

    Read the article

  • copying program arguments to a whitespace separated std::string

    - by PaulH
    I have a Visual Studio 2008 C++ application where I would like to copy all of program arguments in to a string separated by a whitespace " ". i.e., if my program is called as foo.exe \Program Files, then my folder string below would contain \Program Files Below is an example of what I'm doing now. I was wondering if there was a shorter or easier method of doing this. Is there an easy way to eliminate the std::wstringstream variable? int _tmain( int argc, _TCHAR* argv[] ) { std::wstringstream f; std::copy( argv + 1, argv + argc, std::ostream_iterator< std::wstring, wchar_t >( f, L" " ) ); std::wstring folder = f.str(); // ensure the folder begins with a backslash if( folder[ 0 ] != L'\\' ) folder.insert( 0, 1, L'\\' ); // remove the trailing " " character from the end added by the std::copy() above if( *folder.rbegin() == L' ') folder.erase( folder.size() - 1 ); // ... } Thanks, PaulH

    Read the article

  • read pair of characters separated by \t c++

    - by Kiran
    Friends, I want to read a pair of characters separated by \t. I want to continue reading the input until user enters z for any of the characters. Here are the options I thought: while (cinch1ch2) { // process ch1 & ch2 } std::string str; while (getline(cin, str) ){ //split string } Also, I want to validate the input to make sure that it is correct. Please suggest the best way. If this is a duplicate, please point me to the right one. Thanks.

    Read the article

  • Auto-converting numbers to comma-fied versions

    - by Jeff Atwood
    Given the following text /feeds/tag/remote-desktop 1320 17007 22449240 /feeds/tag/terminal-server 1328 15805 20989040 /foo/23211/test 1490 11341 16898090 Let's say we want to convert those numbers to their comma-fied forms, like so /feeds/tag/remote-desktop 1,320 17,007 22,449,240 /feeds/tag/terminal-server 1,328 15,805 20,989,040 /foo/23211/test 1,490 11,341 16,898,090 (don't worry about fixing the fixed-width ASCII spacing, that's a problem for another day) This is the best regex I could come up with; it's based on this JavaScript regex solution from Regex Ninja Steven Levithan: return Regex.Replace(s, @"\b(?<!\/)\d{4,}\b(?<!\/)", delegate(Match match) { string output = ""; string m = match.Value; int len = match.Length; for (int i = len - 1; i >= 0 ; i--) { output = m[i] + output; if ((len - i) % 3 == 0) output = "," + output; } if (output.StartsWith(",")) output = output.Substring(1, output.Length-1); return output; }); In a related question, there is a very clever number comma insertion regex proposed: text = Regex.Replace(text, @"(?<=\d)(?=(\d{3})+$)", ",") However this requires an end anchor $ which, as you can see, I don't have in the above text -- the numbers are "floating" in the rest of the text. I suspect there is a cleaner way to do this than my solution? After writing this, I just realized I could combine them, and put one Regex inside the other, like so: return Regex.Replace(s, @"\b(?<!\/)\d{4,}\b(?<!\/)", delegate(Match match) { return Regex.Replace(match.Value, @"(?<=\d)(?=(\d{3})+$)", ","); });

    Read the article

  • Cann Boost Program_options separate comma separated argument values

    - by lrm
    If my command line is: > prog --mylist=a,b,c Can Boost's program_options be setup to see three distinct argument values for the mylist argument? I have configured program_options as: namespace po = boost::program_options; po::options_description opts("blah") opts.add_options() ("mylist", std::vector<std::string>>()->multitoken, "description"); po::variables_map vm; po::store(po::parse_command_line(argc, argv, opts), vm); po::notify(vm); When I check the value of the mylist argument, I see one value as a,b,c. I'd like to see three distinct values, split on comma. This works fine if I specify the command line as: > prog --mylist=a b c or > prog --mylist=a --mylist=b --mylist=c Is there a way to configure program_options so that it sees a,b,c as three values that should each be inserted into the vector, rather than one? I am using boost 1.41, g++ 4.5.0 20100520, and have enabled c++0x experimental extensions.

    Read the article

  • classic asp ignore comma within speach marks CSV

    - by user2968227
    I Have a CSV File that looks like this 1,HELLO,ENGLISH 2,HELLO1,ENGLISH 3,HELLO2,ENGLISH 4,HELLO3,ENGLISH 5,HELLO4,ENGLISH 6,HELLO5,ENGLISH 7,HELLO6,ENGLISH 8,"HELLO7, HELLO7 ...",ENGLISH 9,HELLO7,ENGLISH 10,HELLO7,ENGLISH I want to step loop through the lines and write to a table using split classic asp function by comma. When Speech marks are present to ignore the comma within those speech marks and take the string. Please help. <% dim csv_to_import,counter,line,fso,objFile csv_to_import="uploads/testLang.csv" set fso = createobject("scripting.filesystemobject") set objFile = fso.opentextfile(server.mappath(csv_to_import)) str_imported_data="<table cellpadding='3' cellspacing='1' border='1'>" Do Until objFile.AtEndOfStream line = split(objFile.ReadLine,",") str_imported_data=str_imported_data&"<tr>" total_records=ubound(line) for i=0 to total_records if i>0 then str_imported_data=str_imported_data&"<td>"&line(i)&"</td>" else str_imported_data=str_imported_data&"<th>"&line(i)&"</th>" end if next str_imported_data=str_imported_data&"</tr>" & chr(13) Loop str_imported_data=str_imported_data&"<caption>Total Number of Records: "&total_records&"</caption></table>" objFile.Close response.Write str_imported_data %>

    Read the article

  • comma separated values in oracle function body

    - by dmitry
    I've got following oracle function but it does not work and errors out. I used Ask Tom's way to convert comma separated values to be used in select * from table1 where col1 in <> declared in package header: TYPE myTableType IS table of varchar2 (255); Part of package body: l_string long default iv_value_with_comma_separated|| ','; l_data myTableType := myTableType(); n NUMBER; begin begin LOOP EXIT when l_string is null; n := instr( l_string, ',' ); l_data.extend; l_data(l_data.count) := ltrim( rtrim( substr( l_string, 1, n-1 ) ) ); l_string := substr( l_string, n+1 ); END LOOP; end; OPEN my_cursor FOR select * from table_a where column_a in (select * from table (l_data)); CLOSE my_cursor END; above fails but it works fine when I remove select * from table (l_data) Can someone please tell me what I might be doing wrong here??

    Read the article

  • Objective C number keypad, custom comma button

    - by rom_j
    I'm trying to add a comma button on a number keypad that has previous, next and done buttons, so that it looks like this : Problem is, that the orange button does not respond to taps. Actually if I moved it above the "7" button and tapped it, the 7 would be tapped. So my orange button may be shown above the keyboard, but it's reacting to taps as if it were below. Here is an abstract of my code : -(void)textFieldDidBeginEditing:(UITextField *)textField{ UIView *inputAccessoryView = [[UIView alloc] initWithFrame:CGRectMake(0, 500, screenWidth, 40.0)]; // 3 buttons on top UIView *topToolbar = [[UIView alloc] initWithFrame:CGRectMake(0, 0.0, screenWidth, 40.0)]; [topToolbar addSubview:self.inputPrevButton]; [topToolbar addSubview:self.inputNextButton]; [topToolbar addSubview:self.inputDoneButton]; [inputAccessoryView addSubview:topToolbar]; // Comma button UIButton *commaButton = [UIButton buttonWithType:UIButtonTypeCustom]; [commaButton setFrame: CGRectMake(0, 204, 105, 52)]; [commaButton setTitle:@"." forState:UIControlStateNormal]; [commaButton addTarget:self action:@selector(addComma) forControlEvents:UIControlEventTouchUpInside]; [commaButton setBackgroundColor:[UIColor orangeColor]]; [inputAccessoryView addSubview:commaButton]; // Useless, but tried anyway [inputAccessoryView bringSubviewToFront:commaButton]; [textField setInputAccessoryView:self.inputAccessoryView]; } All I know is that I should not be doing this (which is actually not working), so what should I do ?

    Read the article

  • Can Boost Program_options separate comma separated argument values

    - by lrm
    If my command line is: > prog --mylist=a,b,c Can Boost's program_options be setup to see three distinct argument values for the mylist argument? I have configured program_options as: namespace po = boost::program_options; po::options_description opts("blah") opts.add_options() ("mylist", std::vector<std::string>>()->multitoken, "description"); po::variables_map vm; po::store(po::parse_command_line(argc, argv, opts), vm); po::notify(vm); When I check the value of the mylist argument, I see one value as a,b,c. I'd like to see three distinct values, split on comma. This works fine if I specify the command line as: > prog --mylist=a b c or > prog --mylist=a --mylist=b --mylist=c Is there a way to configure program_options so that it sees a,b,c as three values that should each be inserted into the vector, rather than one? I am using boost 1.41, g++ 4.5.0 20100520, and have enabled c++0x experimental extensions.

    Read the article

  • Adding a Way To preserve A Comma In A CSV To DataTable Function

    - by Nick LaMarca
    I have a function that converts a .csv file to a datatable. One of the columns I am converting is is a field of names that have a comma in them i.e. "Doe, John" when converting the function treats this as 2 seperate fields because of the comma. I need the datatable to hold this as one field Doe, John in the datatable. Function CSV2DataTable(ByVal filename As String, ByVal sepChar As String) As DataTable Dim reader As System.IO.StreamReader Dim table As New DataTable Dim colAdded As Boolean = False Try ''# open a reader for the input file, and read line by line reader = New System.IO.StreamReader(filename) Do While reader.Peek() >= 0 ''# read a line and split it into tokens, divided by the specified ''# separators Dim tokens As String() = System.Text.RegularExpressions.Regex.Split _ (reader.ReadLine(), sepChar) ''# add the columns if this is the first line If Not colAdded Then For Each token As String In tokens table.Columns.Add(token) Next colAdded = True Else ''# create a new empty row Dim row As DataRow = table.NewRow() ''# fill the new row with the token extracted from the current ''# line For i As Integer = 0 To table.Columns.Count - 1 row(i) = tokens(i) Next ''# add the row to the DataTable table.Rows.Add(row) End If Loop Return table Finally If Not reader Is Nothing Then reader.Close() End Try End Function

    Read the article

  • A dot between two numbers is converted to comma

    - by Isaac
    For example when i want to write 1.1 in MS Word, the . is suddenly converted to ',' when i write the second 1. Here is a illustration of what happens: Notes: I am typing in Arabic and i want the numbers Arabic. When I am typing in English it is fined and everything is better than expected: The . remains . I tried to reset Word settings based on the all the ways that MSDN suggests. Now all the styles and options are set to default and all add-ons are removed. I also tried to reset my Regional and Languages settings to a Standard one. I have also changed all the , separators to . How can i stop the Word from changing my dots to commas? (It only happens when dot is between two digits)

    Read the article

  • CSS: Horizontal, comma-separated list with fixed <li> width

    - by hello
    Hello, I would like to achieve the following structure: [gfhtfg..., kgjrfg..., asd, mrhgf, ] ^-------^ ^-------^ ^-------^ ^-------^ X X X X (X = a fixed length) I've got a <div> with a fixed length, and inside it an horizontal, comma-separated list (ul) of links. The <li> elements should have a fixed width, and so if the links exceed a fixed length an ellipsis will be shown (using the text-overflow property). I know two ways to make a list horizontal. One is using display: inline and the other using the float property. With the first approach, I can't set a fixed width because the CSS specification doesn't allow setting the width of inline elements. The second approach creates a mess :O Setting float on the <a> element, intending to limit the width there, separates it from the commas. There are no browser-compatibility issues, I only have to support WebKit. I included the code I attempted to work with: <!DOCTYPE html> <html lang="en"> <head> <title>a title</title> <style> body { font-family: arial; font-size: 10pt; } div { height: 30px; width: 300px; background: #eee; border: 1px solid #ccc; text-align: center; } ul { margin: 0px; padding: 0px; } ul li:after { content: ","; } ul li:last-child:after { content: ""; } ul li a { text-decoration: none; color: #666; } ul li { margin: 0px; padding: 0px; list-style: none; overflow: hidden; text-overflow: ellipsis; -webkit-text-overflow: ellipsis; /* Inline elements can't have a width (and they shouldn't according to the specification */ display: inline; width: 30px; } </style> </head> <body> <div> <ul> <li><a href="#">a certain link</a></li> <li><a href="#">link</a></li> <li><a href="#">once again</a></li> <li><a href="#">another one</a></li> </ul> </div> </body> </html> Thank you.

    Read the article

  • Flex: replace all spaces with comma

    - by Treby
    im new with regexp, so can i ask for some assistance Using string.replace function what code that can replace spaces with comma Input:The quick brown fox jumps over the lazy dog. Output:The,quick,brown,fox,jumps,over,the,lazy dog. Thanks

    Read the article

  • How Do I Convert Pipe Delimited to Comma Delimited with Escaping

    - by Russ Bradberry
    Hi, I am fairly new to scala and I have the need to convert a string that is pipe delimited to one that is comma delimited, with the values wrapped in quotes and any quotes escaped by "\" in c# i would probably do this like this string st = "\"" + oldStr.Replace("\"", "\\\\\"").Replace("|", "\",\"") + "\"" I haven't validated that actually works but that is the basic idea behind what I am trying to do. Is there a way to do this easily in scala?

    Read the article

  • python: strip comma end of string

    - by krisdigitx
    how do i strip comma from the end of an string, i tried awk = subprocess.Popen([r"awk", "{print $10}"], stdin=subprocess.PIPE) awk_stdin = awk.communicate(uptime_stdout)[0] print awk_stdin temp = awk_stdin t = temp.strip(",") also tried t = temp.rstrip(","), both don't work.

    Read the article

  • Good way to deal with comma seperated values in oracle

    - by dmitry
    I am getting passed comma seperated values to a stored procedure in oracle. I want to treat these values as a table so that I can use them in a query like: select * from tabl_a where column_b in (<csv values passed in>) What is the best way to do this in 11g? Right now we are looping through these one by one and inserting them into a gtt which I think is ineffecient. Any pointers?

    Read the article

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