Hi all, I need to read a text file (I've attached it, you can take a look), and then store all the numbers in it into a 2D array. After which, I need to parse it. I need urgent help here! ):

Member Avatar
Member Avatar
-2 forum 49

I have about 15,000 emails in google that were sent from a wordpress webform. I need to be able to extract data from that email and export to excel. Are there any suggestions? I have started using Parseur. But I need to be able to foward all 15,000 emails but Google is only allowing 100 per day. Also Parseur has a fee.

Member Avatar
Member Avatar
+0 forum 1

Getting the follwoing error message. How to fix this? **Parse error: syntax error, unexpected end of file in** Actual Code: <?php session_start(); include("connection.php"); $sqlsettings = "SELECT * from admin"; $resultsettings = mysql_query($sqlsettings); $rowsettings = mysql_fetch_array($resultsettings); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title><?php echo $rowsettings['ScriptName']; ?> - World's No. 1 Matrimonial Website Script</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="css/landing.css" type="text/css"> <link rel="stylesheet" href="css/homepage.css" type="text/css"> <script language="Javascript" src="js/matrimonials-v10.js" type="text/javascript"></script> <script language="Javascript" src="js/matrimonials-landing1.js"></script> <script language="Javascript" src="js/mouseovereffect.js"></script> <script language="Javascript" src="js/home-pg.js" type="text/javascript"></script> </head> <body style="margin: 0px;"> <a name="Matrimonials"></a> <a name="Matrimonial"></a> <center> <div class="width"> <div class="graytxt smallcnt" style="padding: 2px 0px; …

Member Avatar
Member Avatar
+0 forum 1

Stupid constant in class declaration issue One of our live servers is still on php 5.3 and is breaking on the second line with this message Parse error: syntax error, unexpected '.', expecting ')' in ....... systemAdministrator is a defined constant that i can echo out with no problem before this any help would be appreciated $errors = array( 1 => array('code' => 1, 'mesg' => 'Error connecting to server: Please contact your <a href="mailto:' . systemAdministrator . '">System Administrator</a>'), ......., ......., );

Member Avatar
Member Avatar
+0 forum 1

Hey guys, this seems to be a thorn in my side. I've been working on scraping a website which uses aspx and has eventvalidation/viewstate inputs. Every other scraping experiment I've made was not this difficult. Maybe one of you geniuses here at Daniweb has an idea of how to solve this? I've managed to get Selenium/PHPUnit to automate the process of opening the browser, typing in the URL, filling out the required fields (todays date), and then landing on the page I need to scrape and can get the viewstate and eventvalidation values from any of those pages. I've been …

Member Avatar
Member Avatar
+0 forum 2

Hello: I am getting a parse error while running a file on my server on my home machine: Parse error: syntax error, unexpected end of file I have been researching this for a few hours now but have had no results to overcome this error. In the editor it is indicating the last line, </html>, but I am sure that last line is correct and the error must lie somewhere in the code above that. Any advice or pointers in the right direction would be much appreciated. ` <!-- The tab on top --> <div class="tab"> <ul class="login"> <li class="left">&nbsp;</li> …

Member Avatar
Member Avatar
+0 forum 3

I am working with two seperate files which contain similar code - One throws a parse error for an identical line, the other does not. I do not understand why this would be. **The error on the file that will not run is**: Parse error: syntax error, unexpected '2' (T_LNUMBER) Here is a code snippet that works without the parse error: `if (($indx % 2) == 1) {$rowClass = $trOdd; } else { $rowClass = $trEven; } echo '<tr '.$rowClass.'>';` Here is a code snippet that does not work and has the parse error: `if (($indx % 2) == 1) …

Member Avatar
Member Avatar
+0 forum 3

<?php include 'Classes/PHPExcel.php'; include 'Classes/PHPExcel/Writer/Excel2007.php'; include 'Classes/PHPExcel/IOFactory.php'; require_once 'Spreadsheet\Excel/Writer.php' ; require_once 'Spreadsheet\Excel\Writer/Workbook.php' ; //E:\Program Files\EasyPHP-DevServer-14.1VC11\data\localweb\generer\Spreadsheet\Excel\Writer try { echo date('H:i:s') . " Create new PHPExcel object\n"; echo "redderr " ; $data = new Spreadsheet_Excel_Reader("GenerationDesNoeuds.xls"); $data->dump($row_numbers=false,$col_letters=false,$sheet=0,$table_class='excel') $workbook = new Spreadsheet_Excel_Writer('GenerationDesNoeuds.xls'); $worksheet =& $workbook->addWorksheet('My first worksheet'); if (PEAR::isError($worksheet)) { die($worksheet->getMessage()); } $workbook->close(); exit ; } catch (Exception $e) { $error =$e->getMessage(); } ?> Parse error: syntax error, unexpected '$workbook' (T_VARIABLE) in E:\Program Files\EasyPHP-DevServer-14.1VC11\data\localweb\generer\modifier.php on line 19

Member Avatar
Member Avatar
+0 forum 4

Hello there :) I got this json: http://steamcommunity.com/id/spekat/inventory/json/730/2 In place of "spekat" - has different account names with different information. I want to get "classid" index with information (like numbers) Now my code is like this: <?php $urljson2 = file_get_contents("http://steamcommunity.com/id/$steam_acc/inventory/json/730/2/"); $json_decode2 = json_decode($urljson2); $inventory = $json_decode2->rgInventory->classid; ?> But not work, maybe because after rgInventory have numbers (index) wich i dont know. My questions is how to skip this index and direct getting info from classid ? Thanks!

Member Avatar
Member Avatar
+0 forum 1

package my_package; my_object obj_instance; String my_string; my_string = obj_instance.toString(); System.out.println(my_string) ; // gives my_package.my_object@asj128 // I've lost track of obj_instance but it in memory // and I want to recover it from my_string , like my_object obj_instance1 obj_instance1 = ( my_object) my_string ; some thing like string to object converstion how can we do this ? obviously above typecasting doesn't work in Java :)

Member Avatar
Member Avatar
+0 forum 9

Hello. I have one problem with only one text witch shows two times (i want only once) Here is picture: http://i.imgur.com/cfOrBCs.png Maybe the for cycle loops this text and...this is happen. I want to show only once in the middle. Here is code: var matchcount = 4; $.ajax({ type: 'GET', url: 'http://counter-strike.net/jsfeed/gosumatches', dataType: 'json', cache: true, data: { 'count': matchcount }, success: function(data) { var html = ''; for ( c = 0; c < matchcount; c++ ) { m = data[c]; html += '<div class="upcomingmatch">'; html += '<b>'+m.name+'</b>'; html += '<div class="um_time">'+m.time+'</div>'; for ( i = 0; i <= …

Member Avatar
+0 forum 0

Hello, I got terrible need :) I have this: $profile_data = file_get_contents("http://tyxo.bg/d/148025/daily"); $sep1 = explode('<table id="general-table">', $profile_data); $set2 = explode("</table>", $sep1[1]); echo $set2[0]; which output this: http://i.imgur.com/2THUUve.png I need to export only this values without anything else: http://i.imgur.com/IQG708Q.png You can test by your self the code i give - he outputs the html which is needed to parse from preg_replace or something else maybe? I dont know how to proceed, this is not my best part. I want to get only values in red (only this - without anything else) And i want to separate by comma everything value. I …

Member Avatar
Member Avatar
+0 forum 6

Hi everybody, I have a file with some tags like html. *<instance id="bass.1000000" docsrc = "BNC/A0C"> <answer instance="bass.1000000" senseid="bass%fish"/> <context> Try it with grilled sea <head>bass</head> and fennel. </context> </instance>* I need to parse it and retrieve some information like id and senseid in answer tag. How can I do this? I add <html> &<body> and write this code. But it does not work. HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); doc.LoadHtml(sourcefile); HtmlNodeCollection collection = doc.DocumentNode.SelectNodes("//instance"); foreach (HtmlNode n in collection) { label1.Text+=n.Attributes["id"].Value; }

Member Avatar
Member Avatar
+0 forum 4

I'm trying to parse equations like these which only has two values or the square root of a certain value from a text file: 100+100 -100-100 -(100)+(-100) sqrt(100) by the minues signs, parenthesis and the operator symbol in the middle and the square root, and i have no idea how to start off...i've got the file part done and the simple calculation parts except that i couldnt get my program to solve the equations in the above. char *tok = buff; sscanf(tok,"%lf%c%lf",&num1,&sym,&num2); that is what have i written for the other basic operations without parenthesis and the minus sign for …

Member Avatar
Member Avatar
+0 forum 5

Hello. I am a complete newbit to Python. I am trying to read a text file (which is actually an svg file) and add a line to the text file. I would also like to remove certain text from the file. I am trying to edit some of the tags in the file. Here is the code that I have so far. I have only figured out how to read the file and append to it. But I don't know how to do actual edits. def main(): f = open("F01.svg", "r") if f.mode == 'r': fl = f.readlines() for x …

Member Avatar
Member Avatar
+0 forum 2

how to fix below error Notice: Error: Table 'oc_product_profile' already exists Error No: Table 'oc_product_profile' already exists CREATE TABLE `oc_product_profile` ( `product_id` int(11) NOT NULL, `profile_id` int(11) NOT NULL, `customer_group_id` int(11) NOT NULL, PRIMARY KEY (`product_id`,`profile_id`,`customer_group_id`) ) ENGINE=MyISAM COLLATE=utf8_general_ci; in /home3/ffashion/public_html/ffashionfox.com/system/database/mysql.php on line 51 and my sql database is: <?php final class DBMySQL { private $link; public function __construct($hostname, $username, $password, $database) { if (!$this->link = mysql_connect($hostname, $username, $password)) { trigger_error('Error: Could not make a database link using ' . $username . '@' . $hostname); } if (!mysql_select_db($database, $this->link)) { trigger_error('Error: Could not connect to database ' . $database); } …

Member Avatar
Member Avatar
+0 forum 3

In the last few days, I have noticed a very old thread ... resurrected ... about a non-standard C getline function. To all who may like a C readLine function ... a C function that reads in a dynamic C string of any length ... a function with a similar feel to the C++ getline function ... please feel free to use readLine.h (to access readLine) ... or readWord.h (to access readWord) These are freely available at: [For ... readLine and readWord ... Click Here](http://developers-heaven.net/forum/index.php/topic,2580.msg2864.html#msg2864)

Member Avatar
+0 forum 0

Hello everyone! Needing some help with styling a DOM parse. I have been toying around with the style but continue to end up with whitespace parse errors... So first of all here is the working code Sorry about the paste however the code snippet continued to display: The code snippet in your post is formatted incorrectly. Please use the Code button in the editor toolbar when posting whitespace-sensitive text or curly braces. Even though I was using the code button. Currently the list parses in a direct row going down. I want it to display 4-5 elements on a line …

Member Avatar
Member Avatar
+0 forum 5

i am very, very very new to all of this.. seem to have got what i wanted for the most part.. i am putting a little weather widget on our business website... and have everthing working fine except sunset, sunrise... i think because it has subcatagories.. how do i pull these?? see below: <sunset> <hour>20</hour> <minute>48</minute> </sunset> − <sunrise> <hour>5</hour> <minute>06</minute> </sunrise> im trying to call it using: $sun = "Dawn: $sunrise - Dusk: $sunset"; but it comes up just blank if i just use $hour:$minute it defaults to the sunrise hour minute (must read bottom to top?) im sure …

Member Avatar
Member Avatar
+0 forum 10

dear all, i want to parse this url: http://core3.oomph.co.id/api_omph_playground/index.php/nav/get_menu/1002/ to get all image, selectedImage, and url value. and my php syntax is: <?php $url1 = "http://core3.oomph.co.id/api_omph_playground/index.php/nav/get_menu/1002/"; $url = file_get_contents("$url1"); $arr = json_decode($url,true); foreach($arr['menu']['image'] as $item) { echo "image: ". $item[0] ."<br>"; echo "image_selected: ". $item[1] ."<br>"; echo "url: ". $item[2] ."<br>"; } ?> but i got Warning: Invalid argument supplied for foreach(), so how to get expected results?

Member Avatar
Member Avatar
+0 forum 3

What I'm attempting to do is read a text document to pass in variables into an arraylist of shape objects that I will use to create shapes. I don't need any help with the actual drawing of the shapes, working with the arraylist, or the initial scanning setup. I thought about doing a while loop to read each word/int using the single whitespace in between as the delimiter. Where I get stuck is what exactly I should do with information I don't need. For example, I would test the line to see if it said start via an if statement. …

Member Avatar
Member Avatar
+0 forum 10

Hi, This is my first post, forgive me for not being immediately familiar with any forum protocols. I am trying to read in a txt file and store the data in my class. I keep running into this error Exception in thread "main" java.lang.NumberFormatException: For input string: "./src.Chance" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:481) at java.lang.Integer.parseInt(Integer.java:527) at Driver.main(Driver.java:31) this is my code import java.util.*; public class Driver { private static Scanner stringScan; private static Scanner cardScan; public static void main(String[] args) { // TODO Auto-generated method stub //Instantiations Card Chance[] = new Card[16]; cardScan = new Scanner("./src.Chance"); while (cardScan.hasNext()) { stringScan = …

Member Avatar
Member Avatar
+0 forum 2

Quite commonly I see people using one of the Parse routines then catching the exception thrown if the parse fails. This is, in general, a bad practice as throwing an exception is slower than using the corresponding TryParse method. This short snippet shows the routines that I used to measure the timing of each. The results on 100,000 strings, 1/2 of which were 'bad' was: [code=text]TryParse took 1,142 milliseconds Exception took 56,179 milliseconds[/code] As you can see Exceptions are over 50 times slower. Get into the habit of using TryParse. Before you bring it up, yes parsing 100,000 strings in …

Member Avatar
Member Avatar
+0 forum 5

Hi guys, I have got a problem with scraping the data from a third party website. I'm currently using a preg_match_all method with each different title tags including the values to output the data from a third party website to my website where I can see some of the data are missing. Here's what the HTML is look like from a third party: <span id="row1Time" class="zc-ssl-pg-time">9:00 AM</span> <a id="rowTitle1" class="zc-ssl-pg-title">CBS News Sunday Morning</a> <span id="row2Time" class="zc-ssl-pg-time">10:30 AM</span> <a id="rowTitle2" class="zc-ssl-pg-title">Face the Nation</a> <span id="row3Time" class="zc-ssl-pg-time">11:30 AM</span> <span id="rowTitle3" class="zc-ssl-pg-title">Local Programming</span> <span id="row4Time" class="zc-ssl-pg-time">12:00 PM</span> <a id="rowTitle4" class="zc-ssl-pg-title">The NFL Today</a> <span …

Member Avatar
Member Avatar
+0 forum 1

The following code snippet shows how you can parse a DSN (Data Source Name). Why is it useful? You can now pass a single DSN parameter to your database wrapper class' constructor (instead of five separate parameters), and tear it apart into the components you need. The password and port are considered optional. You may need to tweak the regex if you use other characters than letters, digits or underscores. Questions? Ask!

Member Avatar
+1 forum 0

Hi I need some help please. I am trying to display mysql data on webpage.I got this example from PHPEasyStep but it does not work. I think the code is a few years old and not compatible with my version of Php which is 5.4.Actually I have this problem with most tutorials and it is a shame because it causes a lot of time consuming, I wish these tutorials were updated, would be much easier. Anyway can somebody tell me how to correct the code below so that it does work? Thanks a lot. This is the error I get: …

Member Avatar
Member Avatar
+0 forum 13

hi, i need a parser script of php that stores information like name, dob, address, contact no., education from the resume. the resume can be of .doc,.txt format thanks in advance

Member Avatar
Member Avatar
+0 forum 5

I have this line <INPUT name=c value="<?php echo href="http://',$data2['c'],' " ',$data2['c'],' ?>"> &nbsp; and it is giving out this error Parse error: syntax error, unexpected '=', expecting ',' or ';' in /home/a3024539/public_html/bigtestone1.php on line 21 The output I am looking for is the text from the table to become a link,

Member Avatar
Member Avatar
+0 forum 26

[b]. I have searched google and everywhere before asking this question. I have a forum that the posts support php bbcodes. All basic bbcodes like [b], [i], [h1], e.t.c are working well. I used the str_replace() function for the bbcodes. Now i have a problem on how to create the [quote] bbcode . The quote bbcode tag is in the format [quote=username]. The user wil be detected in the string and used for some database queries. The problem now lies in how to get the username infront of the [quote= in the tag. I'm so so sorry this isnt well …

Member Avatar
Member Avatar
+0 forum 3

What does the PHP error ‘Parse error in PHP – unexpected T_variable at line x’ means?

Member Avatar
Member Avatar
+0 forum 4

The End.