What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Messenger Plus: How To Read a Text File?

Messenger Plus: How To Read a Text File?
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Messenger Plus: How To Read a Text File?
quote:
Originally posted by robert_dll
And how can I read something specific? For example, if I want to read the text next to "hi" in a file which content is "hi robert".
That totally depends on what is static in "hi robert".
  • If you want to read the first word of a file, you can use a regular expression on the file's content:
    Javascript code:
    var sContent = "hi robert";
    var sResult = sContent.match(/^\b(\w+)\b/)[1];
    // Result now equals "hi" as this is the first word

  • If you know that "robert" is always the second word in the file and need to know what's in front of it:
    Javascript code:
    var sContent = "hi robert";
    var sResult = sContent.match(/^(.+)\srobert/)[1];
    // Result now equals "hi" as this comes before "robert"

  • ...
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-25-2009 09:45 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Messenger Plus: How To Read a Text File? - by MrAsterisco on 06-22-2009 at 05:45 PM
RE: Messenger Plus: How To Read a Text File? - by matty on 06-23-2009 at 03:31 AM
RE: Messenger Plus: How To Read a Text File? - by robert_dll on 06-24-2009 at 10:08 PM
RE: Messenger Plus: How To Read a Text File? - by Matti on 06-25-2009 at 09:45 AM
RE: Messenger Plus: How To Read a Text File? - by robert_dll on 06-25-2009 at 02:42 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On