Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Forum De Bell Tolls > [Programmazione] PHP + GD + text parsing
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
fozzy
apprentice monk

User info:
Registered: May 2002
Posts: 1968 (0.23 al dì)
Location: Bollate (MI)
Corso: SA-299
Anno: primo...di studio "serio"
Time Online: 10 Days, 10:57:44 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[Programmazione] PHP + GD + text parsing

gia il titolo fa paura... :D

sto cercando di creare a runtime delle immagini contenenti del testo (banalmente online/offline anche se in realtà mi serve più complessa)
Ho un file di testo nel quale cercare l'esistenza di una determinata stringa e se questa esiste vorrei avere in un array tutta la riga (csv) per poter usare poi i dati contenuti..

Non ho trovato funzioni utili gia esistenti per farlo nel manuale php ma non riesco ad immaginarmi non ci siano..

In quale sezione li dovevo cercare :D

Grazie

__________________
I sense much NT in you, NT leads to Blue Screens,
Blue Screens lead to downtime, downtime leads to suffering.

NT is the path to the Dark Side....

13-09-2003 11:26
Click Here to See the Profile for fozzy Click here to Send fozzy a Private Message Visit fozzy's homepage! Find more posts by fozzy Add fozzy to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
unidavide
.arcimaestro.

User info:
Registered: Nov 2002
Posts: 373 (0.04 al dì)
Location:
Corso:
Anno:
Time Online: 11 Days, 19:48:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Mi sa che non ci sono funzioni specifiche per il csv cmq non basta una cosa del genere?

PHP:

$file = fopen ("temp.csv", "r");
    $riga = 0;
    while (strlen($data = fgets($file, 1024)) !=0 ){
        $findme   = 'stringadatrovare';
        $pos = strpos($data, $findme);
        if ($pos === false) {
            // non trovata in questa riga
        } else {
            // trovata la stringa
            $riga = explode(',', $data);
        }
    }
    if($riga){
        echo "trovata";
    }
    fclose($file);

13-09-2003 12:15
Click Here to See the Profile for unidavide Click here to Send unidavide a Private Message Find more posts by unidavide Add unidavide to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Ryudo
.precettore.

User info:
Registered: Apr 2003
Posts: 85 (0.01 al dì)
Location: Arcore
Corso: Informatica
Anno: 1
Time Online: 3 Days, 8:05:43 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Re: [Programmazione] PHP + GD + text parsing

Originally posted by fozzy

Non ho trovato funzioni utili gia esistenti per farlo nel manuale php ma non riesco ad immaginarmi non ci siano..


fgetcsv legge una riga da un puntatore a file e ritorna un array con i campi cvs

13-09-2003 13:08
Click Here to See the Profile for Ryudo Click here to Send Ryudo a Private Message Visit Ryudo's homepage! Find more posts by Ryudo Add Ryudo to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fozzy
apprentice monk

User info:
Registered: May 2002
Posts: 1968 (0.23 al dì)
Location: Bollate (MI)
Corso: SA-299
Anno: primo...di studio "serio"
Time Online: 10 Days, 10:57:44 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

grazie ad entrambi!
Ho scoperto poi che i campi sono separati da ":"
Sto utilizzando con successo il primo metodo.

Ciao

__________________
I sense much NT in you, NT leads to Blue Screens,
Blue Screens lead to downtime, downtime leads to suffering.

NT is the path to the Dark Side....

13-09-2003 14:42
Click Here to See the Profile for fozzy Click here to Send fozzy a Private Message Visit fozzy's homepage! Find more posts by fozzy Add fozzy to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
AlphaGamma
.piano ma pieni.

User info:
Registered: Jun 2002
Posts: 6732 (0.78 al dì)
Location:
Corso: Eh?
Anno: Io cosa?
Time Online: 21 Days, 21:22:01: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ma che cosa sono i campi cvs?

__________________
Attenzio', concentrazio', ritmo e VITALITÀ

13-09-2003 17:03
Click Here to See the Profile for AlphaGamma Click Here to See the Blog of AlphaGamma Click here to Send AlphaGamma a Private Message Visit AlphaGamma's homepage! Find more posts by AlphaGamma Add AlphaGamma to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
unidavide
.arcimaestro.

User info:
Registered: Nov 2002
Posts: 373 (0.04 al dì)
Location:
Corso:
Anno:
Time Online: 11 Days, 19:48:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by AlphaGamma
Ma che cosa sono i campi cvs?


si chiamano csv non cvs comunque sono "comma separated value".
E' un metodo per memorizzare dei dati (es. una tabella di un db) su un file di testo

13-09-2003 17:18
Click Here to See the Profile for unidavide Click here to Send unidavide a Private Message Find more posts by unidavide Add unidavide to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
AlphaGamma
.piano ma pieni.

User info:
Registered: Jun 2002
Posts: 6732 (0.78 al dì)
Location:
Corso: Eh?
Anno: Io cosa?
Time Online: 21 Days, 21:22:01: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ah, quella cosa che si usa sempre quando non hai il database a disposizione? Stavo associando cvs a sourceforge... :D

__________________
Attenzio', concentrazio', ritmo e VITALITÀ

13-09-2003 17:32
Click Here to See the Profile for AlphaGamma Click Here to See the Blog of AlphaGamma Click here to Send AlphaGamma a Private Message Visit AlphaGamma's homepage! Find more posts by AlphaGamma Add AlphaGamma to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
unidavide
.arcimaestro.

User info:
Registered: Nov 2002
Posts: 373 (0.04 al dì)
Location:
Corso:
Anno:
Time Online: 11 Days, 19:48:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by AlphaGamma
Ah, quella cosa che si usa sempre quando non hai il database a disposizione?


Penso di si, oppure quando devi spostare dei dati da due db e non hai altri mezzi

14-09-2003 12:26
Click Here to See the Profile for unidavide Click here to Send unidavide a Private Message Find more posts by unidavide Add unidavide to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fozzy
apprentice monk

User info:
Registered: May 2002
Posts: 1968 (0.23 al dì)
Location: Bollate (MI)
Corso: SA-299
Anno: primo...di studio "serio"
Time Online: 10 Days, 10:57:44 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

nel post iniziale è scritto correttamente csv... :D
cmq in questo caso sono dei dump in file txt...

ora mi si pone un altro problema.. ho fatto dei test con dei file offline e fin qui tutto bene.. ma se provo ad usare dei file online con lycos sono inchiodato in quanto il php di lycos ha la direttiva allow_url_fopen messa ad off..

qualcuno conosce un servizio di hosting PHP su linux (quindi con GD) che permetta l'apertura di urls come files?

Grazie ancora.

__________________
I sense much NT in you, NT leads to Blue Screens,
Blue Screens lead to downtime, downtime leads to suffering.

NT is the path to the Dark Side....

Last edited by fozzy on 14-09-2003 at 17:09

14-09-2003 16:58
Click Here to See the Profile for fozzy Click here to Send fozzy a Private Message Visit fozzy's homepage! Find more posts by fozzy Add fozzy to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
AlphaGamma
.piano ma pieni.

User info:
Registered: Jun 2002
Posts: 6732 (0.78 al dì)
Location:
Corso: Eh?
Anno: Io cosa?
Time Online: 21 Days, 21:22:01: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Prova free.fr come hosting gratuito.

Ma il mio consiglio e' comprare un hosting quando fai qualche cosa di piu' serio di un phpnuke... ;)

__________________
Attenzio', concentrazio', ritmo e VITALITÀ

15-09-2003 00:24
Click Here to See the Profile for AlphaGamma Click Here to See the Blog of AlphaGamma Click here to Send AlphaGamma a Private Message Visit AlphaGamma's homepage! Find more posts by AlphaGamma Add AlphaGamma to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fozzy
apprentice monk

User info:
Registered: May 2002
Posts: 1968 (0.23 al dì)
Location: Bollate (MI)
Corso: SA-299
Anno: primo...di studio "serio"
Time Online: 10 Days, 10:57:44 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

il punto è che non è una cosa particolarmente seria e non è a pagamento... :D
però non ho verificato i server web dell'ufficio.. magari ce la faccio lì.. :)

__________________
I sense much NT in you, NT leads to Blue Screens,
Blue Screens lead to downtime, downtime leads to suffering.

NT is the path to the Dark Side....

15-09-2003 07:30
Click Here to See the Profile for fozzy Click here to Send fozzy a Private Message Visit fozzy's homepage! Find more posts by fozzy Add fozzy to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fozzy
apprentice monk

User info:
Registered: May 2002
Posts: 1968 (0.23 al dì)
Location: Bollate (MI)
Corso: SA-299
Anno: primo...di studio "serio"
Time Online: 10 Days, 10:57:44 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ho risolto in parte i probleminel senso che ora posso aprire i file remoti ma ho ancora cerrti altri problemi...

posso fare il parsing dei fiel in locale (vedi sopra) non voelndo sovracccaricare il server che tiene il file da cui traggo le informazioni vorrei scriverlo in locale se sono passati meno di 5 minuti dall'ultima lettura del file remoto.
leggo l'ora di modifica del file locale prendo l'ora attuale se la diferenza è meno di 300 scarico di nuovo il file remoto.
mi funiona correttamente la funzione file("URL") ma non riesco a fare in modo che un eventuale $data=file("URL"); si tenga i CR+LF che ci sono nel testo originale... se uso implode che codice gli devo dare?

Grazie ancora :)

__________________
I sense much NT in you, NT leads to Blue Screens,
Blue Screens lead to downtime, downtime leads to suffering.

NT is the path to the Dark Side....

17-09-2003 21:18
Click Here to See the Profile for fozzy Click here to Send fozzy a Private Message Visit fozzy's homepage! Find more posts by fozzy Add fozzy to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 05:09.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.101 seconds (40.44% PHP - 59.56% MySQL) con 24 query.