Oleg_123 at xuppa.com
Oleg_123 at xuppa.com
Tue Sep 7 18:35:38 CDT 2004
Hello Group, I need either transfer txt file to a table either everything(first 2 columns in a text format) or if possible to to transfer first 2 columns in a text format, skip columns 3-8, and then column 9 and everything else. (There is no fixed number of fields(columns) in the text file it varies from 9 to 20) I tried with a macro (but i can't do specifications since i dom't know how columns there'll be) but it for some reason wants to transfer first second column as number (when its clearly text) thus loosing a lot of data. I got this so far, not sure what's next --- Private Sub Command4_Click() On Error Resume Next Dim fs As New Scripting.FileSystemObject Dim ts As Scripting.TextStream Dim gOut As Outlook.Application Dim mOut As Outlook.MailItem Dim strLine As String Dim aRecord If fs.FileExists("C:\Hrsqd.txt") Then MsgBox "Exists" Set ts = fs.OpenTextFile("C:\Hrsqd.txt", ForReading) Do Until ts.AtEndOfStream strLine = ts.ReadLine aRecord = Split(strLine, ",") Loop Else MsgBox "Doesn't Exist" End If End Sub ----------------------------------------- Make Money and Find Love at Finally.com http://www.finally.com/?link=webmail