LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bam Bam is offline
external usenet poster
 
Posts: 48
Default EOF Parse Text file

I have a text file which I need to retrieve the last 6 characters from.

The file Is always 2 Lines and looks like this.

RESULT OK
INFORMATION Add Job 185792


I want to retrieve the (Job) Number at the end - "185792".

My current script looks like this:
(Where strTarget is the textfile.)

Open strTarget For Input As #1
Do While Not EOF(1)
Line Input #1, data
Debug.Print Right(data, 6)
Loop
Close #1

The result however comes out like this:

ULT OK
185792

How Do I Only retrieve the 2nd line of this?

And even better put it into a particular Cell.

Eg: MyRow = ActiveCell.Row
Destination:=Worksheets("Sheet 1").Cells(Myrow, 6)

Thanks?

Bam.
 
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
Open a .csv file, parse text and display on more than one sheet joseph_doggie Excel Programming 3 August 3rd 08 02:30 PM
Want to use Excel to parse a text file Michael[_44_] Excel Programming 17 October 7th 07 09:51 PM
load/parse large text file Keith R Excel Programming 10 April 9th 07 09:49 PM
How to parse data in text file sifar Excel Programming 4 October 8th 05 01:50 AM
Parse Text File John[_62_] Excel Programming 5 October 22nd 03 02:50 PM


All times are GMT +1. The time now is 03:21 AM.

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"