Search Results

Search found 409 results on 17 pages for 'delimiter'.

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

  • MYSQL Event Scheduler DELIMITER using PHP

    - by user1440918
    I'm having an issue with my PHP code trying to create events within MySQL. I begin with creating a string like this: $sql="DELIMITER $$ CREATE EVENT `$test_name` ON SCHEDULE EVERY $time1 $sched2 STARTS '$start_date $start_time' DO BEGIN "; $sql .="INSERT INTO blah (foo,bar); "; $sql .="END$$ DELIMITER ;" mysql_query($sql,$dbh); But I keep getting Syntax Errors starting with DELIMITER $$ CREATE EVENT. Without the semicolon behind (foo,bar); the event triggers with a unexecuted payload. Any ideas on where I'm going wrong? Thanks!

    Read the article

  • Reading CSV files in numpy where delimiter is ","

    - by monch1962
    Hello all, I've got a CSV file with a format that looks like this: "FieldName1", "FieldName2", "FieldName3", "FieldName4" "04/13/2010 14:45:07.008", "7.59484916392", "10", "6.552373" "04/13/2010 14:45:22.010", "6.55478493312", "9", "3.5378543" ... Note that there are double quote characters at the start and end of each line in the CSV file, and the "," string is used to delimit fields within each line. When I try to read this into numpy via: import numpy as np data = np.genfromtxt(csvfile, dtype=None, delimiter=',', names=True) all the data gets read in as string values, surrounded by double-quote characters. Not unreasonable, but not much use to me as I then have to go back and convert every column to its correct type When I use delimiter='","' instead, everything works as I'd like, except for the 1st and last fields. As the start of line and end of line characters are a single double-quote character, this isn't seen as a valid delimiter for the 1st and last fields, so they get read in as e.g. "04/13/2010 14:45:07.008 and 6.552373" - note the leading and trailing double-quote characters respectively. Because of these redundant characters, numpy assumes the 1st and last fields are both String types; I don't want that to be the case Is there a way of instructing numpy to read in files formatted in this fashion as I'd like, without having to go back and "fix" the structure of the numpy array after the initial read?

    Read the article

  • how execute mysql command DELIMITER

    - by user5332
    hi, I have huge problem (for me) I need from PHP execute mysql command DELIMITER | but mysql_query fails on error... and I found that mysql_query doesn't support usage of DELIMITER, because this command may be working only in mysql console but when I open phpMyAdmin ... is there at SQL tab an option to change DELIMITER and it works... but I don't know how... could you help me? who is possile to change delimiter from PHP? I need it to do before CREATE TRIGGER ... that uses several ; that may not be interpreted like command end

    Read the article

  • Python: Split by 1 or more occurrences of a delimiter

    - by Adam Matan
    Hi, I have a formatted string from a log file, which looks like: >>> a="test result" That is, the test and the result are split by some spaces - it was probably created using formatted string which gave test some constant spacing. Simple splitting won't do the trick: >>> a.split(" ") ['test', '', '', '', ... '', '', '', '', '', '', '', '', '', '', '', 'result'] split(DELIMITER, COUNT) cleared some unnecessary values: >>> a.split(" ",1) ['test', ' result'] This helped - but of course, I really need: ['test', 'result'] I can use split() followed by map + strip(), but I wondered if there is a more Pythonic way to do it. Thanks, Adam

    Read the article

  • PHP - fgetcsv - Delimiter being ignored?

    - by KnockKnockWhosThere
    I'm trying to output each line in a csv file, and it seems like the delimiter is being ignored... I'm sure my syntax is wrong somewhere, but can't seem to pinpoint it... The CSV file looks like this: ID,Code,Count TM768889,02001,10 TM768889,02002,10 TM768889,02003,10 TM768889,02004,10 TM768889,02005,10 I'm trying to output: 0 - ID,Code,Count 1 - TM768889,02001,10 2 - TM768889,02002,10 3 - TM768889,02003,10 4 - TM768889,02004,10 5 - TM768889,02005,10 But instead, it's outputting this: 0 - ID 1 - Code 2 - Count TM768889 3 - 02001 4 - 10 TM768889 5 - 02002 6 - 10 TM768889 7 - 02003 8 - 10 TM768889 9 - 02004 10 - 10 TM768889 11 - 02005 12 - 10 Here's my code: $row = 0; if(($handle = fopen($_FILES["Filedata"]["tmp_name"], "r")) !== FALSE) { $string = ''; while(($line = fgetcsv($handle,1000,",")) !== FALSE) { $num = count($line); $row++; for($c=0; $c < $num; $c++) { $string .= $c.' - '.$line[$c].'<br />'; } } fclose($handle); echo $string; }

    Read the article

  • Splitting a string according to a delimiter when elements in the string can contain the delimiter

    - by Vivin Paliath
    I have a string that looks like this: "#Text() #SomeMoreText() #TextThatContainsDelimiter(#blah) #SomethingElse()" I'd like to get back [#Text(), #SomeMoreText(), #TextThatContainsDelimiter(#blah), #SomethingElse()] One way I thought about doing this was to require that the # to be escaped into \#, which makes the input string: "#Text() #SomeMoreText() #TextThatContainsDelimiter(\#blah) #SomethingElse()" I can then split it using /[^\\]#/ which gives me: [#Text(), SomeMoreText, TextThatContainsDelimiter(\#blah), SomethingElse()] The first element will contain # but I can strip it out. However, is there a cleaner way to do this without having to escape the #, and which ensures that the first element will not contain a #? Basically I'd like it to split by # only if the # is not enclosed by parentheses. My hunch is that since the # is context-sensitive and and regular expressions are only suited for context-free strings, this may not be the right tool. If so, would I have to write a grammar for this and roll my own parser/lexer?

    Read the article

  • Java delimiter reader

    - by newbieprogrammer
    I have a colon-delimited text file containing grouped, related data. The People group contains people's names followed by their ages, separated by colons. How can I parse the text and group people according to their ages? The structure is as follows: Group.txt Age:10:20:30:40: Group:G1:10:G2:30:G3:20:G4:40: People:Jack:10:Tom:30:Dick:20:Harry:10:Paul:10:Peter:20: People:Mary:20:Lance:10: And I want to display something like this: G1 Jack Harry Paul Lance G2 Dick Peter Marry G3 Tom G4

    Read the article

  • Replacing delimiter characters in file path

    - by salvationishere
    I'm developing a C# web application in VS 2008. I let the user select an input file and then I store the file path in a string variable. However, it stores this path as "C:\\folder\\...". So my question is how do I convert this file path into single "\"? To clarify more, this is my code in context. Currently it is entering the If Directory does not Exist section. protected void btnAppend_Click(object sender, EventArgs e) { string fullpath = Page.Request.PhysicalPath; fullpath.Replace('\\', '\'); if (!Directory.Exists(fullpath)) { string msg = "<h1>The upload path doesn't exist: {0}</h1>";

    Read the article

  • Code Line Delimiter [closed]

    - by John Isaiah Carmona
    Possible Duplicate: Why are statements in many programming languages terminated by semicolons? I just found out that R Programming Language, which is somewhat belong to the C family (I'm not sure about this but it uses {} instead of begin end), uses a new line as a delimiter for a new line of code instead of the semi-colon ;. Why is some programming language designed to use a new line instead of a symbol like semi-colon which I think will make the code more readable? Phyton total = item_one + \ item_two + \ item_three C total = item_one + item_two + item_three;

    Read the article

  • Determining End of Line Delimiter

    - by Michael Merchant
    How do you verify what the delimiter for a file is? I'm using eclipse to edit a script file on my windows system that I use to deploy on my unix server. The script specifies file names and I'd like to be certain that eclipse is saving the files with unix end of line delimiters. I've set my preferences to use the Unix Line Delimiter on new files using: Window > Preferences > General > Workspace > "New text file line delimiter" And have changed my script file's line delimiter using. File -> Convert Line Delimiters To Is there a way (preferably with the eclipse IDE) to check that there is no "\r"?

    Read the article

  • Delphi - How do I split a string into an array of strings based on a delimiter?

    - by Ryan
    Hello all, I'm trying to find a Delphi function that will split an input string into an array of strings based on a delimiter. I've found a lot on Google, but all seem to have their own issues and I haven't been able to get any of them to work. I just need to split a string like: "word:doc,txt,docx" into an array based on ':'. The result would be ['word', 'doc,txt,docx']. Does anyone have a function that they know works? Thank you

    Read the article

  • C# streamreader, delimiter problem.

    - by Mike
    What I have is a txt file that is huge, 60MB. I need to read each line and produce a file, split based on a delimiter. I'm having no issue reading the file or producing the file, my complication comes from the delimiter, it can't see the delimiter. If anybody could offer a suggestion on how to read that delimiter I would be so grateful. delimiter = Ç public void file1() { string betaFilePath = @"C:\dtable.txt"; StringBuilder sb = new StringBuilder(); using (FileStream fs = new FileStream(betaFilePath, FileMode.Open)) using (StreamReader rdr = new StreamReader(fs)) { while (!rdr.EndOfStream) { string[] betaFileLine = rdr.ReadLine().Split('Ç'); { sb.AppendLine(betaFileLine[0] + "ç" + betaFileLine[1] + betaFileLine[2] + "ç" + betaFileLine[3] + "ç" + betaFileLine[4] + "ç" + betaFileLine[5] + "ç" + betaFileLine[6] + "ç" + betaFileLine[7] + "ç" + betaFileLine[8] + "ç" + betaFileLine[9] + "ç" + betaFileLine[10] + "ç"); } } } using (FileStream fs = new FileStream(@"C:\testarea\load1.txt", FileMode.Create)) using (StreamWriter writer = new StreamWriter(fs)) { writer.Write(sb.ToString()); } }

    Read the article

  • Parse both symbols . and , as decimal digits delimiter in ASP.NET

    - by abatishchev
    I'm writing a banking system and my customer wants support both Russian and American numeric standards in decimal digits delimiter. Respectively . and ,. Now only , works properly. Perhaps because of web server's OS format (Russian is set). String like 2000.00 throws a FormatException: Input string was not in a correct format. How to fix that? Are there any other ideas except String.Replace('.', ',') on FormView.ItemInserting event?

    Read the article

  • Is it safe to use random Unicode for complex delimiter sequences in strings?

    - by ccomet
    Question: In terms of program stability and ensuring that the system will actually operate, how safe is it to use chars like ¦, § or ‡ for complex delimiter sequences in strings? Can I reliable believe that I won't run into any issues in a program reading these incorrectly? I am working in a system, using C# code, in which I have to store a fairly complex set of information within a single string. The readability of this string is only necessary on the computer side, end-users should only ever see the information after it has been parsed by the appropriate methods. Because some of the data in these strings will be collections of variable size, I use different delimiters to identify what parts of the string correspond to a certain tier of organization. There are enough cases that the standard sets of ;, |, and similar ilk have been exhausted. I considered two-char delimiters, like ;# or ;|, but I felt that it would be very inefficient. There probably isn't that large of a performance difference in storing with one char versus two chars, but when I have the option of picking the smaller option, it just feels wrong to pick the larger one. So finally, I considered using the set of characters like the double dagger and section. They only take up one char, and they are definitely not going to show up in the actual text that I'll be storing, so they won't be confused for anything. But character encoding is finicky. While the visibility to the end user is meaningless (since they, in fact, won't see it), I became recently concerned about how the programs in the system will read it. The string is stored in one database, while a separate program is responsible for both encoding and decoding the string into different object types for the rest of the application to work with. And if something is expected to be written one way, is possibly written another, then maybe the whole system will fail and I can't really let that happen. So is it safe to use these kind of chars for background delimiters?

    Read the article

  • SEO - Delimiter character for page title

    - by cept0
    I have noticed a few oddities recently with the titles of web pages in SERPs. However, it seems there are several main conventions: Contact Page - Joe Schmoe's Awesome Site // &#045; Hyphen Contact Page — Joe Schmoe's Awesome Site // &mdash; Em dash Contact Page | Joe Schmoe's Awesome Site // &#x007C; Vertical bar Contact Page « Joe Schmoe's Awesome Site // &laquo; Left double angle quotes Is there any reason to use one over the other?

    Read the article

  • Split String in C# without delimiter (sort of)

    - by Zach
    Hi, I want to split a string in C#.NET that looks like this: string Letters = "hello"; and put each letter (h, e, l, l, o) into an array or ArrayList. I have no idea what to use as the delimiter in String.Split(delimiter). I can do it if the original string has commas (or anything else): string Letters = "H,e,l,l,o"; string[] AllLettersArray = Letters.Split(",".ToCharArray()); But I have no idea what to use in a case with (supposedly) no delimiter. Is there a special character like Environment.Newline? Thanks.

    Read the article

  • Invisible Delimiter for Strings in HTML

    - by noah
    I need a way to identify certain strings in HTML markup. I know what the strings are, but it is possible that they could be substrings of other strings in the document. To find them, I output a special delimiter character (currently using \032). On page load, we go through the HTML and record the location of the strings, and remove the delimiter. Unfortunately, most browsers show the delimiter character until we can find and remove them all. I'd like to avoid that if possible. Is there a character or string that will be preserved in the HTML content (so a comment wont work) but wont be visible to the user? It also needs to be something that is fairly unlikely to appear next to a string, so something like &nbsp; wouldn't work either. EDIT: Sorry, I forgot to mention that the strings will be in attributes, so any sort of tag wont work.

    Read the article

  • mysql changing delimiter

    - by jimsmith
    I'm trying to add this function using php myadmin, first off I get on error line 5, which is apparently because you need to change the delimiter from ; to something else so i tried this DELIMITER | CREATE FUNCTION LEVENSHTEIN (s1 VARCHAR(255), s2 VARCHAR(255)) RETURNS INT DETERMINISTIC BEGIN DECLARE s1_len, s2_len, i, j, c, c_temp, cost INT; DECLARE s1_char CHAR; DECLARE cv0, cv1 VARBINARY(256); SET s1_len = CHAR_LENGTH(s1), s2_len = CHAR_LENGTH(s2), cv1 = 0x00, j = 1, i = 1, c = 0; IF s1 = s2 THEN RETURN 0; ELSEIF s1_len = 0 THEN RETURN s2_len; ELSEIF s2_len = 0 THEN RETURN s1_len; ELSE WHILE j <= s2_len DO SET cv1 = CONCAT(cv1, UNHEX(HEX(j))), j = j + 1; END WHILE; WHILE i <= s1_len DO SET s1_char = SUBSTRING(s1, i, 1), c = i, cv0 = UNHEX(HEX(i)), j = 1; WHILE j <= s2_len DO SET c = c + 1; IF s1_char = SUBSTRING(s2, j, 1) THEN SET cost = 0; ELSE SET cost = 1; END IF; SET c_temp = CONV(HEX(SUBSTRING(cv1, j, 1)), 16, 10) + cost; IF c > c_temp THEN SET c = c_temp; END IF; SET c_temp = CONV(HEX(SUBSTRING(cv1, j+1, 1)), 16, 10) + 1; IF c > c_temp THEN SET c = c_temp; END IF; SET cv0 = CONCAT(cv0, UNHEX(HEX(c))), j = j + 1; END WHILE; SET cv1 = cv0, i = i + 1; END WHILE; END IF; RETURN c; END DELIMITER ; But I get this error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delimiter | Please help !?

    Read the article

  • Splitting strings using a delimiter in python.

    - by Jahkr
    OK so I have a string that has this: Dan|warrior|54 I'm trying to make so I can use python and split it using | as the delimiter. Here's what I have so far: #!/usr/bin/env python dan = 'dan|warrior|54' print dan.split('|') and that results into this: ['dan', 'warrior', '54'] I know it's incomplete but what do I have to do to finish it? Yes, I tried googling this problem... but it's not happening. :( I want so that I can choose specifically which one from the delimiter so if I was dan.split('|')[1] .. it would pick warrior. See my point?

    Read the article

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