79 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Sunshineserene

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 for Red_2
-2
19K
Member Avatar for jstfsklh211

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 …

Member Avatar for diafol
0
255
Member Avatar for mattyd

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 …

Member Avatar for Albert Pinto
0
341
Member Avatar for ddanbe

I have strings representing an angle, of the format ddd°mm'ss''. I want to get to the three constituents: degrees, minutes and seconds. I first chopped off the seconds like this: `angleString = “ddd°mm'ss''”;` `string str = angleString.Substring(0, angleString.Length - 2);` Then I tried to do this, to get to the …

Member Avatar for JOSheaIV
0
240
Member Avatar for mattyd

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) …

Member Avatar for mattyd
0
417
Member Avatar for imti321

<?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 …

Member Avatar for imti321
0
351
Member Avatar for grakovski

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, …

Member Avatar for gabrielcastillo
0
432
Member Avatar for grakovski

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', …

0
219
Member Avatar for rakibtg

I am using PHP Simple HTML DOM Parser to fetch urls, but i got an error while fetching links. Have a look at this script: $result = str_get_html($result); foreach($result->find('a') as $element) $result = str_get_html($result); $result = str_replace('http://', '', $result); foreach($result->find('a') as $elementa) echo $element->href; echo $elementa->href; Here I want to …

Member Avatar for sagar.shetty.946
0
2K
Member Avatar for grakovski

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 …

Member Avatar for diafol
0
5K
Member Avatar for edogg23

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 …

Member Avatar for edogg23
0
365
Member Avatar for Labdabeta

Hello, I recently took a course on assembler/compiler construction. In it we covered parsing algorithms such as LL(n), LR(n), LALR(n), and SLR(n). I understand how these parsing algorithms can be used to determine **if** an input string follows a context free grammar (CFG). At some point I also understood how …

Member Avatar for Labdabeta
0
283
Member Avatar for raheel88

All, What is the most efficient way of writing several lines of data to a *.txt file? Currently, I store the required text in memory then write it all to a user-specified text file at the end, similar to the following; Dim text As String = "" text = text …

Member Avatar for dionterry
0
3K
Member Avatar for silent lover

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] …

Member Avatar for pzuurveen
0
268
Member Avatar for Hanyouslayer

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 …

Member Avatar for Hanyouslayer
0
799
Member Avatar for qew.brown

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) …

Member Avatar for qew.brown
0
257
Member Avatar for perly

I have a large data set (12,000 rows X 14 columns); the first 4 rows as below: x1 y1 0.02 NAN NAN NAN NAN NAN NAN 0.004 NAN NAN NAN NAN x2 y2 NAN 0.003 NAN 10 NAN 0.03 NAN 0.004 NAN NAN NAN NAN x3 y3 NAN NAN NAN …

Member Avatar for perly
0
250
Member Avatar for 3e0jUn

I've been looking for a way to parse a simple XML-like language for use as a type of data storage. I've been through stuff like JSON, XML, etc but I don't want to use them because they are quite slow. I just need a simple way to parse this: [stuff] …

Member Avatar for james.lu.75491856
0
428
Member Avatar for Fiorentino01^

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 …

Member Avatar for Fiorentino01^
0
352
Member Avatar for thearts.beach

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 …

Member Avatar for thearts.beach
0
289
Member Avatar for Suzie999

(edit) this is solved, was a unicode issue. Hi I'm hoping someone has used the library [pugixml](http://pugixml.org/) I'm just trying to use a simple example provided but I'm not getting the result I expect. int _tmain(int argc, _TCHAR* argv[]) { pugi::xml_document doc; pugi::xml_parse_result result = doc.load_file("tree.xml"); //pugi::char_t * c = …

0
152
Member Avatar for fheppell

I need to connect to the wikipedia search API. Here is an example response <api> <query-continue> <search sroffset="10"/> </query-continue> <query> <searchinfo totalhits="169717"/> <search> <p ns="0" title="Intelligence quotient" timestamp="2013-04-04T05:15:12Z"/> <p ns="0" title="Test" timestamp="2013-02-23T01:15:05Z"/> <p ns="0" title="TeST Gliders" timestamp="2012-09-22T11:05:05Z"/> <p ns="0" title=".test" timestamp="2013-02-25T14:48:22Z"/> <p ns="0" title="Test cricket" timestamp="2013-04-02T18:49:54Z"/> <p ns="0" title="Test (assessment)" …

Member Avatar for fheppell
0
184
Member Avatar for phfilly

Hi all! I have a problem that I've been struggling with for quite sometime. In short I've successfully parsed a xml file from a string. But I can't seem to access the correct elements. The thing is I'm reading the xml file data via javascript but in the xml file …

Member Avatar for phfilly
0
4K
Member Avatar for spowel4

Using this example json file: { "stores": [ { "storeName":"AUGUSTA", "company":"CC", "emailAddresses": ["spowel4@gmail.com", "spowel4@yahoo.com", "steve@compsysplus.com"] }, { "storeName":"CHATTANOOGA", "company":"CC", "emailAddresses": ["spowel4@gmail.com"] } ] } I have this code to try to parse the file: public static void main(final String[] args) throws Exception { // TODO code application logic here ObjectMapper …

Member Avatar for spowel4
0
9K
Member Avatar for krimgo

Hi, I've just started out with Python and I've been stuck on this problem for a few hours now trying to parse a file into a certain format.. I am trying to create a list in a list out of a list. I currently have this list; ['MPNRRRCKLSTAISTVATLAIASPCAYFLVYEPTASAKPAAKHYEFKQAASIADLPGEVLDAISQGLSQFGINL', 'MQLVDRVRGAVTGMSRRLVVGAVGAALVSGLVGAVGGTATAGAFSRPGLPVEYLQVPSPSMGRSELPGWLQA', 'etc'] …

Member Avatar for krimgo
0
340
Member Avatar for 3e0jUn

So I have a code that prints out the `sys.argv` when the program is ran. How can I parse $ python ./arch.py install * to show `["./arch.py","install","*"]` Instead of `["./arch.py","install",#other files in directory]`?

Member Avatar for deceptikon
0
198
Member Avatar for kozer

Please can someone help me and send me in the right direction. I am making a program that reads a text file and then out puts the data into a datagrid, the text file looks like this: [HRData] 84 73 0 -124 0 50 84 73 0 -124 0 50 …

Member Avatar for Ketsuekiame
0
841
Member Avatar for adishardis

Hi, I, getting a new xml file everyday to one of our external ftp servers. I want to get that file and then insert select data into my mysql. What I'm thinking is that I would use curl to get the file, then simplexml and then insert into database. But …

Member Avatar for adishardis
0
216
Member Avatar for ssfreaky

Hi, I am a site owner with zero php experience. I have accidently deleted one letter from a header script and it caused my site to crash. I need desperate help. It shows Parse error: syntax error, unexpected T_STRING in /home/spark496/public_html/www.sourcetutoring.com/wp-content/themes/directorypress/header.php on line 152. Can any expert please help? This …

Member Avatar for widi05
0
358
Member Avatar for bops

Hi, I have quite a large CSV file (Around 20,000 rows with about 20 columns) that I am trying to manipulate. Initially I am looking for a way to get out the first 10 or so records after they have been sorted in ascending order on one of the numeric …

Member Avatar for bops
0
1K

The End.