Hi
I trying to import a text file (CSV ) , but inside text there are one or more in text that there is ;
The text "Outros bolos industrializados e produtos de panificação não especificados anteriormente; exceto casquinhas para sorvete e pães" must to be only a column, but there a ; inside , how can I to do a workaround ?Code:1;XX;17.062.00;;"Outros bolos industrializados e produtos de panificação não especificados anteriormente; exceto casquinhas para sorvete e pães";;30,93
Code:Dim file_name As String Dim fnum As Integer Dim whole_file As String Dim lines As Variant Dim one_line As Variant Dim num_rows As Long Dim num_cols As Long Dim the_array() As String Dim R As Long Dim C As Long Dim STR_IE As String Dim str_sql As String '---------------------------------- '-DELETe records '---------------------------------- gDatabase.DbExecuteSQL "BEGIN DELETE WRK_CEST_IE; COMMIT; END;" file_name = App.Path If Right$(file_name, 1) <> "\" Then file_name = _ file_name & "\" file_name = file_name & "test.csv" file_name = txtArquivo ' Load the file. fnum = FreeFile Open file_name For Input As fnum whole_file = Input$(LOF(fnum), #fnum) Close fnum ' Quebra o arquivo em Linhas lines = Split(whole_file, vbCrLf) ' Dimensiona o array num_rows = UBound(lines) one_line = Split(lines(0), ";") num_cols = UBound(one_line) ReDim the_array(num_rows, num_cols) STR_IE = "E" If Len(lines(0)) > 0 Then one_line = Split(lines(0), ";") For C = 0 To num_cols 'the_array(0, C) = one_line(C) Next C End If




Reply With Quote
