FATI Comune mortale
Registrato: 28/02/07 12:47 Messaggi: 1 Residenza: parma
|
Inviato: 13 Mar 2007 09:31 Oggetto: conversione di txt con VB6 |
|
|
vi chiedo un aiuto ad un problema che sicuramente a voi sembra banale...
Ho scrito questo codice per convertire un file txt in un file sotto forma di tabella con tanti righe quanti sono le linee de txt e tanti collonne quanti sono i teste separati da "," nel file txt.
Vorrei chr qualcuno mi lo puo correggere, perche mi si blocca nella
FOR i=0 to UBound(Riga)
Grazie in anticipo:
rivate Sub Command1_Click()
Dim myarray() As String
Dim Riga() As String
Dim Campi() As String
'Apri il file
On Error GoTo er1
'
Buffer = ""
Text2.Text = ""
CommonDialog1.ShowOpen
FileNumber = FreeFile
'
'
Open CommonDialog1.FileName For Input As #FileNumber
Do While Not EOF(FileNumber)
Buffer = Buffer + Input(1, #FileNumber)
'
Riga() = Split(Buffer, vbCrLf)
For i = LBound(Riga) To UBound(Riga)
Input #FileNumber, Riga(i)
Text2.Text = Text2.Text & Riga(i) & vbCrLf
myarray(i) = Riga(i)
'
Next
Loop
Text2.Text = Buffer
Close #FileNumber
Command2.Enabled = True
er1:
End Sub
|
|