473,836 Members | 1,903 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

parseing text file from web server

2 New Member
I play a game that has raw news feeds stored in txt on there website. located
[HTML]http://a.swirve.com/data[/HTML]
My problem is I know nothing about PHP.
The basics of what I am trying to do is scan the file, insert into a mysql database.
Right now there is a whole sets worth of data. But when the next set starts there wont be that many files, or same file names used. The one thing that stays the same is the next to last file is the current hour of news. I am hoping to scan the txt files once every 5 mins. Any help would be appreciated.
Feb 26 '07 #1
1 1127
jdrechsler
2 New Member
[PHP]<?php
$filename = "personal.t xt";
$data = file( $filename );
foreach( $data as $jai )
]
{ [/PHP]

Thats what I have so far to open the txt file. Thou I not sure how to get that open the 2nd from the bottom file.

I got some help with inserting into mysql database

[PHP]
$jaiql = mysql_query("IN SERT msql_table VALUES ('', '{$jai[0]}', '{$jait[3]}', '{$jait[7]}', '{$jai[1]}', '{$jai[2]}', '{$jai[3]}', '{$jai[4]}', '{$jai[5]}', '{$jai[6]}', '{$jai[7]}', '{$jai[8]}')");

print("$jai[0]--$jait[3]--$jai... -- $jai[4] -- $jai[5] - $jai[6] - $jai[7] - $jai[8]");
[/PHP]
Feb 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
609
by: Kevin Ingram | last post by:
Ok, this is probably a silly question but I just keep hitting a brick wall here. I usually develop my sites entirely in ASP and use a database for data storage, works great for me. I also sometimes save information to a text file on my server like c:\invoices\customername.txt for batch processing later... I use the FSO commands and it all works slick. Now, I have a new project: A client wants us to log in to their website on another...
2
1818
by: Fred | last post by:
Hi, I am parsing a small xml document and the parseing goes 'all funny' when parsing this element: <useragent>Mozilla/4.61 (WinNT; I)</useragent> I've created a subclass of org.xml.sax.helpers.DefaultHandler, and an instance of this subclass is set on my org.apache.xerces.parsers.SAXParser:
2
1360
by: An S. | last post by:
I have created a little "update" system, that tells when a update from nvidia is released, currently it tells it from a "simple" protocol "S2P", i have been told that XML, is much easier, for the client to download, and then read it afterwards, sooo does anyone know a good XML parseing libary? thanks FreeGeG
6
1233
by: Brian Henry | last post by:
How would you parse this type of file into an array? "Test","Help, data","hello there, this text has commas","commas seperate data, and in quotes they dont" where the double quotes are the string markers, which can contain comma's, but when you are not in a quote block the commas seperate the data... you're basic Comma seperated value file... thanks (i know split doesnt work for this... thats why im asking)
1
2413
by: svijay | last post by:
hi I have got a strange problem. May I know any solution for this. Here is the detailed description about the problem We have got a mainframe system and also production and development server.
4
7403
by: Andyza | last post by:
I'm using FileSystemObject to open and write to a tab delimited text file. First, I connect to a database and select some data. Then I create the text file and insert each record in the text file. At the end of each record I insert a vbCrLf character in the text file to create a new line. Thus each record is in a new line. The problem is that I get a tab delimited text file where the LAST LINE in the text file is always a blank line....
4
1046
by: guy | last post by:
I have a large number of html file (10,000+) and need to programmatical modify them on a regular basis. How can I determine the textual data that is present, ignoring tags etc so if i have a line such as:- <TD WIDTH="524"><B><FONT SIZE="2" FACE="Times New Roman" COLOR="#000000">Direction2</FONT></B></TD> I need to return "Direction2" and nothing else
13
31446
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one outside of our domain, we get the error.. ** Client found response content type of 'text/html; charset=Windows-1252', but expected 'text/xml' **. We can discover the web service by typing in the url of the asmx so we know the server can 'see' it...
0
9654
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10818
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9348
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6972
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5641
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4436
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3094
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.