Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Importing Text File

Dear All,
I waNt to connect to a text file in the memmory
so i can read line by line in the memmory to test a certain conditions and
to trim from it
and i do these opeartions i want to get these procced data to an exile file

optional :
if i can use the open dialog tool to open a file with certain condition

Tanks For Your Cooperation
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Importing Text File

I don't know how your data are arranged in your text file so the macro below
assumes strings of text. You will have to alter this to suit your needs.

Sub getdata()
Filename = Application.GetOpenFilename
If Filename = "False" Then Exit Sub
x = 1
Open Filename For Input As #1
Do While Not EOF(1)
Input #1, Line$
bitiwant$ = Mid$(Line$, 4, 4)
anotherbitiwant$ = Mid$(Line$, 31, 22)
Worksheets("Sheet1").Cells(x, 1).Value = bitiwant$
Worksheets("sheet1").Cells(x, 2).Value = anotherbitiwant$
x = x + 1
Loop
Close #1
End Sub

Mike


"Import Text File" wrote:

Dear All,
I waNt to connect to a text file in the memmory
so i can read line by line in the memmory to test a certain conditions and
to trim from it
and i do these opeartions i want to get these procced data to an exile file

optional :
if i can use the open dialog tool to open a file with certain condition

Tanks For Your Cooperation

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing CSV file (saved as Text) into XL as Text -- over 60 colu sbp Excel Discussion (Misc queries) 1 October 14th 06 11:50 PM
Importing TEXT file from web Murtaza Excel Programming 1 September 26th 06 03:51 AM
Importing text file, only option to edit existing file smokey99 Excel Discussion (Misc queries) 8 April 26th 06 09:08 PM
Importing text file Jillianno Excel Discussion (Misc queries) 1 February 16th 05 06:47 PM
importing text file, removing data and outputting new text file Pal Excel Programming 8 February 27th 04 08:32 PM


All times are GMT +1. The time now is 01:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"