Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 11

Discussione: [Vb 6] Gestione file

  1. #1

    [Vb 6] Gestione file

    Devo gestire un file che non ha estensione praticamente per visualizzare i dati devo utilizzare notepad++
    il problema e' che gestendo il file con il line input mi legge tutto il file in una volta es.
    a
    b
    c
    d
    e

    quando vado a leggere
    codice:
    Dim stringa As String
    Private Sub Command1_Click()
    
    If Not EOF(1) Then
    Line Input #1, stringa
    Text1.Text = stringa
    End If
    End Sub
    
    Private Sub Form_Load()
    Open "services" For Input As #1
    End Sub
    mi esce "abcde" infatti il file services con il normale editor di windows non riesco a visualizzare il file



    qualche metodo per risolvere il problema?

  2. #2
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,480
    Non ho capito ... cosa è questo file "services" ?
    No MP tecnici (non rispondo nemmeno!), usa il forum.

  3. #3
    riguarda le liste canali dei decoder satellitari
    ecco l'inizio del file
    codice:
    eDVB services /2/
    transponders
    00820000:0064:fbff
    	s 11219000:27500000:0:3:130:2
    /
    00820000:00c8:013e
    	s 11240000:27500000:1:3:130:2
    /
    00820000:00c9:0006
    	s 10775000:28000000:0:3:130:2
    /
    00820000:012d:0006
    	s 11095000:28000000:0:3:130:2
    /
    00820000:01f4:013e
    	s 11296000:27500000:0:3:130:2
    /
    00820000:0320:fbff
    	s 11355000:27500000:1:3:130:2
    /
    00820000:03e8:013e
    	s 11393000:27500000:1:3:130:2
    /
    00820000:044c:013e
    	s 11411000:27500000:0:4:130:2
    /
    00820000:05dc:013e
    	s 11488000:27500000:0:3:130:2
    /
    00820000:0640:013e
    	s 11508000:27500000:1:4:130:2
    /
    00820000:06a4:013e
    	s 11526000:27500000:0:3:130:2
    /
    00820000:0708:00c8
    	s 11541000:22000000:1:4:130:2
    /
    00820000:1388:013e
    	s 11727000:27500000:1:3:130:2
    /
    00820000:13ef:013e
    	s 11747000:27500000:0:3:130:2
    /
    00820000:1450:013e
    	s 11765000:27500000:1:2:130:2
    /
    00820000:1518:013e
    	s 11804000:27500000:1:2:130:2
    /
    00820000:157c:013e
    	s 11823000:27500000:0:3:130:2
    /
    00820000:15e0:fbff
    	s 11842000:27500000:1:3:130:2
    /
    00820000:1644:fbff
    	s 11861000:27500000:0:3:130:2
    /
    00820000:16a8:fbff
    	s 11880000:27500000:1:3:130:2
    /
    00820000:170c:fbff
    	s 11900000:27500000:0:3:130:2
    /
    00820000:1770:0110
    	s 11919000:27500000:1:2:130:2
    /
    00820000:17d4:013e
    	s 11938000:27500000:0:3:130:2
    /
    00820000:1838:fbff
    	s 11958000:27500000:1:3:130:2
    /
    00820000:189c:fbff
    	s 11976000:27500000:0:3:130:2
    /
    00820000:1964:013e
    	s 12015000:27500000:0:3:130:2
    /
    00820000:19c8:fbff
    	s 12034000:27500000:1:3:130:2
    /
    00820000:1a2c:fbff
    	s 12054000:27500000:0:3:130:2
    /
    00820000:1a90:fbff
    	s 12072000:27500000:1:3:130:2
    /
    00820000:1af4:fbff
    	s 12091000:27500000:0:3:130:2
    /
    00820000:1b58:013e
    	s 12111000:27500000:1:3:130:2
    /
    00820000:1bbc:013e
    	s 12130000:27500000:0:3:130:2
    /
    00820000:1c20:013e
    	s 12149000:27500000:1:3:130:2
    /
    00820000:1c84:013e
    	s 12169000:27500000:0:3:130:2
    /
    00820000:1ce8:0071
    	s 12188000:27500000:1:3:130:2
    /
    00820000:1d4d:013e
    	s 12207000:27500000:0:3:130:2
    /
    00820000:1e14:013e
    	s 12245000:27500000:0:3:130:2
    /
    00820000:1edc:0071
    	s 12284000:27500000:0:3:130:2
    /
    00820000:1fa4:013e
    	s 12322000:27500000:0:3:130:2
    /
    00820000:20d0:013e
    	s 12379000:27500000:1:3:130:2
    /
    00820000:2134:013e
    	s 12399000:27500000:0:3:130:2
    /
    00820000:2198:fbff
    	s 12418000:27500000:1:3:130:2
    /
    00820000:21fc:013e
    	s 12437000:27500000:0:3:130:2
    /
    00820000:2260:fbff
    	s 12465000:29900000:1:3:130:2
    /
    00820000:2328:013e
    	s 12519000:27500000:1:3:130:2
    /
    00820000:238c:013e
    	s 12539000:27500000:0:3:130:2
    /
    00820000:23f0:013f
    	s 12558000:27500000:1:3:130:2
    /
    00820000:24b8:013e
    	s 12596000:27500000:1:3:130:2
    /
    00820000:251c:fbff
    	s 12616000:27500000:0:3:130:2
    /
    00820000:2580:fbff
    	s 12635000:27500000:1:3:130:2
    /
    00820000:25e4:02be
    	s 12654000:27500000:0:3:130:2
    /
    00820000:2648:fbff
    	s 12673000:27500000:1:3:130:2
    /
    00820000:26ac:013f
    	s 12692000:27500000:0:3:130:2
    /
    00820000:2710:fbff
    	s 12713000:27500000:1:3:130:2
    /
    00820000:2774:fbff
    	s 12731000:27500000:0:3:130:2
    /
    00820000:2af8:013e
    	s 10719000:27500000:1:3:130:2
    /
    00820000:2b5c:013e
    	s 10723000:29900000:0:3:130:2
    /
    00820000:2bc0:013e
    	s 10758000:27500000:1:4:130:2
    /
    00820000:2c88:013e
    	s 10796000:27500000:1:3:130:2
    /
    00820000:2cec:013e
    	s 10815000:27500000:0:4:130:2
    /
    00820000:2db4:013e
    	s 10853000:27500000:0:3:130:2
    /
    00820000:2e18:00b0
    	s 10873000:27500000:1:3:130:2
    /
    00820000:2e7c:013e
    	s 10892000:27500000:0:3:130:2
    /
    00820000:2f44:013e
    	s 10930000:27500000:0:3:130:2
    /
    00820000:2fa8:013e
    	s 10949000:27500000:1:3:130:2
    /
    00820000:300c:013e
    	s 10971000:27500000:0:3:130:2
    /
    00820000:3070:013e
    	s 10992000:27500000:1:2:130:2
    /
    00820000:30d4:013e
    	s 11013000:27500000:0:3:130:2
    /
    00820000:3138:013e
    	s 11034000:27500000:1:3:130:2
    /
    00820000:319c:013e
    	s 11054000:27500000:0:4:130:2
    /
    00820000:3200:013e
    	s 11075000:27500000:1:3:130:2
    /
    00820000:32c8:013e
    	s 11116000:27500000:1:3:130:2
    /
    00820000:332c:013e
    	s 11137000:27500000:0:3:130:2
    /
    00820000:3390:0071
    	s 11159000:27500000:1:3:130:2
    /
    00820000:33f4:013e
    	s 11179000:27500000:0:3:130:2
    /
    00820000:3458:013e
    	s 11200000:27500000:1:4:130:2
    /
    00820000:3bc4:013e
    	s 11565000:27500000:0:3:130:2
    /
    00820000:3c28:013e
    	s 11585000:27500000:1:3:130:2
    /
    00820000:3c8c:013e
    	s 11604000:27500000:0:4:130:2
    /
    00820000:3cf0:013e
    	s 11623000:27500000:1:3:130:2
    /
    00820000:3d54:013e
    	s 11642000:27500000:0:3:130:2
    /
    00820000:3db8:013e
    	s 11662000:27500000:1:3:130:2
    /
    00820000:3e1c:013f
    	s 11681000:27500000:0:3:130:2
    /
    0082ac37:0001:0001
    	s 11319000:27500000:1:3:130:2
    /
    0082acce:0578:013e
    	s 11470000:27500000:1:4:130:2
    /
    0082afc2:0065:0001
    	s 12226000:16300000:1:3:130:2
    /
    end
    services
    2136:00820000:3070:013E:1:0
    Rai Movie
    p:RAI
    213F:00820000:3070:013E:1:0
    Rai 1
    p:RAI
    2140:00820000:3070:013E:1:0
    Rai 2
    p:RAI
    2141:00820000:3070:013E:1:0
    Rai 3
    p:RAI
    2142:00820000:3070:013E:1:0
    Rai 4
    p:RAI
    2144:00820000:3070:013E:1:0
    Rai News
    p:RAI
    2143:00820000:3070:013E:2:0
    FD Leggera
    p:RAI
    2167:00820000:3070:013E:2:0
    Multilingue 1
    p:RAI
    2168:00820000:3070:013E:2:0
    Multilingue 2
    p:RAI
    2169:00820000:3070:013E:2:0
    SatelRadio
    p:RAI
    216A:00820000:3070:013E:2:0
    Radio OM unica
    p:RAI
    216B:00820000:3070:013E:2:0
    Radio2 mono
    p:RAI
    216C:00820000:3070:013E:2:0
    Radio3 mono
    p:RAI
    3607:00820000:00C8:013E:1:0
    ESP Int'l
    p:Eutelsat
    3608:00820000:00C8:013E:1:0
    ESP Romanian
    p:Eutelsat
    3609:00820000:00C8:013E:1:0
    ESP Dutch
    p:Eutelsat
    360A:00820000:00C8:013E:1:0
    ESP Polish
    p:Eutelsat
    360B:00820000:00C8:013E:1:0
    ESP Russian
    p:Eutelsat
    360C:00820000:00C8:013E:1:0
    ESP Portuguese
    p:Eutelsat
    360D:00820000:00C8:013E:1:0
    ESP Hungarian
    p:Eutelsat
    360E:00820000:00C8:013E:1:0
    Prod ESP
    p:Eutelsat
    360F:00820000:00C8:013E:1:0
    ESP Czech
    p:Eutelsat
    3610:00820000:00C8:013E:1:0
    ESP Greek
    p:Eutelsat
    3611:00820000:00C8:013E:1:0
    ESP Cyprus
    p:Eutelsat
    3612:00820000:00C8:013E:1:0
    ESP Bulgarian
    p:Eutelsat
    3613:00820000:00C8:013E:1:0
    ESP2 Turk
    p:Eutelsat
    3614:00820000:00C8:013E:1:0
    ESP Serbia
    p:Eutelsat
    3615:00820000:00C8:013E:1:0
    ESP Turk
    p:Eutelsat
    3616:00820000:00C8:013E:1:0
    ESP2 German
    p:Eutelsat
    3617:00820000:00C8:013E:1:0
    ESP2 Serbia
    p:Eutelsat
    3619:00820000:00C8:013E:1:0
    France 24 (en Francais)
    p:Eutelsat
    361A:00820000:00C8:013E:1:0
    France 24 (in English)
    p:Eutelsat
    3624:00820000:00C8:013E:1:0
    SSU
    p:Eutelsat
    3628:00820000:00C8:013E:1:0
    EUROSPORT2 PL
    p:Eutelsat
    3629:00820000:00C8:013E:1:0
    EUROSPORT PL
    p:Eutelsat
    362F:00820000:00C8:013E:1:0
    La Une
    p:Eutelsat
    3630:00820000:00C8:013E:1:0
    La Deux
    p:Eutelsat
    3631:00820000:00C8:013E:1:0
    RTL-TVi
    p:Eutelsat
    3632:00820000:00C8:013E:1:0
    Club-RTL
    p:Eutelsat
    3633:00820000:00C8:013E:1:0
    Plug-RTL
    p:Eutelsat
    3634:00820000:00C8:013E:1:0
    Disney Channel
    p:Eutelsat
    3635:00820000:00C8:013E:1:0
    ESP2 NE Intl
    p:EUROSPORT
    3636:00820000:00C8:013E:1:0
    ESP2 NE Polish
    p:EUROSPORT
    3637:00820000:00C8:013E:1:0
    ESP2 NE Bulgarian
    p:EUROSPORT
    3638:00820000:00C8:013E:1:0
    ESP2 NE Serbian
    p:EUROSPORT
    3639:00820000:00C8:013E:1:0
    ESP2 NE Czech
    p:EUROSPORT
    363A:00820000:00C8:013E:1:0
    ESP2 NE Danish
    p:EUROSPORT
    363B:00820000:00C8:013E:1:0
    ESP2 NE Russian
    p:EUROSPORT
    363C:00820000:00C8:013E:1:0
    ESP2 NE Swedish
    p:EUROSPORT
    363D:00820000:00C8:013E:1:0
    ESP ECH
    p:EUROSPORT
    363E:00820000:00C8:013E:1:0
    ESP2 NE UPC
    p:EUROSPORT
    363F:00820000:00C8:013E:1:0
    ESP2 NE Hungary
    p:EUROSPORT
    3640:00820000:00C8:013E:1:0
    ESP2 NE Romania
    p:EUROSPORT
    35E9:00820000:00C8:013E:1:0
    ESP2 Int'l
    p:Eutelsat
    35EB:00820000:00C8:013E:1:0
    Prod ESP2
    p:Eutelsat
    35EC:00820000:00C8:013E:1:0
    ESP2 Test
    p:Eutelsat
    35ED:00820000:00C8:013E:1:0
    ESP2 Greek
    p:Eutelsat
    35F5:00820000:00C8:013E:1:0
    ESP2 Rus
    p:Eutelsat
    35FD:00820000:00C8:013E:1:0
    ESP2 Romanian
    p:Eutelsat
    1309:00820000:2E7C:013E:1:0
    DTV CABLE JE
    p:CYFRA +
    130A:00820000:2E7C:013E:1:0
    DTV CABLE KU
    p:CYFRA +
    praticamente io devo riuscire a ricavare solo i nomi
    questo file lo apro con notepad++ ma con quello di windows non ci riesco
    praticamente quando leggo il file in vb6 mi legge tutto come se fosse in una riga

  4. #4
    tu arrivi fino alla fine del file.
    Prova a fare un ciclo fino a quando non trovi il carattere invio, poi fai un altro fino alla fine del file.
    p.s. la textbox devi metterla multiline...

  5. #5
    nel codice che ho scritto cosa dovrei modificare per fare quello che dici?(non so come leggere il file fino al carattere invio)



    ps: a me interessa leggere il file rigo per rigo

  6. #6
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,480
    Se non ho capito male, il file proviene da un sistema Unix/Linux e quindi ogni linea non è terminata da CR/LF ma solo da LF.

    Puoi leggi il file nella variabile stringa e poi separa le linee con

    codice:
        Dim line() As String
        Dim i As Long
        
        line = Split(stringa, vbLf)
    A questo punto avrai tutte le linee separate nel vettore line
    No MP tecnici (non rispondo nemmeno!), usa il forum.

  7. #7
    codice:
    Dim stringa As String
    
        
    Private Sub Command1_Click()
    
    If Not EOF(1) Then
    Line Input #1, stringa
    End If
    
     Dim line() As String
        Dim i As Long
         line = Split(stringa, vbLf)
         
    
         
         
    End Sub
    
    Private Sub Form_Load()
    Open "services" For Input As #1
    End Sub
    come faccio poi ad aggiungere ogni riga letta ad una listbox o textbox?

  8. #8
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,480
    Usa un ciclo for per esplorare tutto il vettore e aggiungi ogni elemento nella Listbox
    No MP tecnici (non rispondo nemmeno!), usa il forum.

  9. #9
    quello l'ho fatto solo che ora emerge un problema
    come faccio a sapere quanti valori ho nel vettore per decidere fino a quanto dovrà ciclare?

  10. #10
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,480
    Originariamente inviato da marcello90
    quello l'ho fatto solo che ora emerge un problema
    come faccio a sapere quanti valori ho nel vettore per decidere fino a quanto dovrà ciclare?
    Basta studiare il linguaggio, prima di iniziare a programmare.

    Usa la funzione

    UBound
    http://msdn.microsoft.com/en-us/libr...(v=VS.60).aspx
    No MP tecnici (non rispondo nemmeno!), usa il forum.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.