Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you run the 'character' example, you will see that the output might
not be very useful for your purpose (includes end of line character 13). The 'get lines' one will probably be best. You will, of course, need to point to one of your own files. '--------------------------------------------------- Sub GET_CHARACTERS() Dim MyChar ToRow = 1 Open "C:\test.txt" For Input As #1 ' Open file. Do While Not EOF(1) ' Loop until end of file. MyChar = Input(1, #1) ' Get one character. ActiveSheet.Cells(ToRow, 1).Value = MyChar ToRow = ToRow + 1 Loop Close #1 ' Close file. End Sub '----------------------------------------------------- Sub GET_LINES_FROM_TEXTFILE() Dim MyString As String Dim ToRow As Long '---------------------- ToRow = 1 Open "C:\test.txt" For Input As #1 ' Open file Do While Not EOF(1) ' Check for end of file. Line Input #1, MyString ' Read line of data. ActiveSheet.Cells(ToRow, 1).Value = MyString ToRow = ToRow + 1 Loop Close #1 ' Close file. End Sub '------------------------------------------------------ --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Files saved as csv files are actually saved as text files? | Excel Discussion (Misc queries) | |||
Text Files | Excel Discussion (Misc queries) | |||
Excel (xls) files spontaneously converting to text files | Excel Discussion (Misc queries) | |||
Text Files | Excel Discussion (Misc queries) | |||
how do i convert text files into CSV files? | Excel Discussion (Misc queries) |