+ Reply to Thread
Results 1 to 4 of 4

Read value from certain line in text file

  1. #1
    Registered User
    Join Date
    06-16-2012
    Location
    norway
    MS-Off Ver
    Excel 2010
    Posts
    2

    Red face Read value from certain line in text file

    Hello!

    I have a small problem I hope some of you guys/girls migth help me with.

    I have a continuously updating textfile. Each (lets say 1 second intervals) a new dataset (of 10 rows) is written into this file, at bottom.

    I would like to read (at a click of a button) certain lines counted from bottom of this file, and put theese into a list on a worksheet. '

    Lets say row 2 and 3 (from bottom of textfile), is put into A1 and B1.

    So that next time I press the button, row 2 and 3 (from bottom of textfile), is put into A2 and B2.


    Anyone to help a desperate girl with this? I'm quite lost...

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Read value from certain line in text file

    This should do it:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-16-2012
    Location
    norway
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Read value from certain line in text file

    Thank you for answering! But this takes the last two lines, I would like it to read the 2nd and 3rd line from bottom.

    Examples:
    ....
    Some text A
    Some text B
    Some text C
    Some text D
    Some text E < -- Read this line
    Some text F < -- Read this line
    Some text G (last line)

    I'm not that good to explain, but I hope you understand

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Read value from certain line in text file

    My bad.... one more level:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1