Sign in to follow this  
Followers 0
xXx

FileReadLineFromTo - is there a function like this?

11 posts in this topic

hi its me again :">

is it possible to read only a part from a line of a textfile? like:

the file would have this as example:

-------------------

Line1

Line2

Line3Line3

Line4

Line5-i-only-want-to-read-this-in-bold-Line5

Line6

-------------------

so i would like to read only the bolded part....

is that possible? is there already a function to make this?

Share this post


Link to post
Share on other sites



hi its me again :">

is it possible to read only a part from a line of a textfile? like:

the file would have this as example:

-------------------

Line1

Line2

Line3Line3

Line4

Line5-i-only-want-to-read-this-in-bold-Line5

Line6

-------------------

so i would like to read only the bolded part....

is that possible? is there already a function to make this?

How about stringsplit()

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

How about stringsplit()

hm but - is not a separator.

the line would be like:

|6456138                 |

and i only want to read the numbers

so how would i do that with stringsplit?

Edited by xXx

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

If there is extra spaces, you could check out the ClearWhiteSpace() or something like that, its in the String section.

Edited by ending

Share this post


Link to post
Share on other sites

$sLine = "|6456138                 |"
$aLineNums = StringRegExp($sLine, "(\d+)", 1)
MsgBox(0, "Numbers", $aLineNums[0])

Share this post


Link to post
Share on other sites

$sLine = "|6456138                 |"
$aLineNums = StringRegExp($sLine, "(\d+)", 1)
MsgBox(0, "Numbers", $aLineNums[0])
and with this example? i want only that it shows 6A5E1F8 but if i change \d+ to \A+ it will take Hex

even if i change to \x+ it will take 01

|Hex 01: 6A5E1F8                 |

Edit: im searching right now for a fix or the other flags maybe i get one while you're reading this

Share this post


Link to post
Share on other sites

and with this example? i want only that it shows 6A5E1F8 but if i change \d+ to \A+ it will take Hex

even if i change to \x+ it will take 01

|Hex 01: 6A5E1F8                 |

Edit: im searching right now for a fix or the other flags maybe i get one while you're reading this

It would help if you would post exactly what you are wanting to match the first time.

$sLine = "|Hex 01: 6A5E1F8                 |"
$aLineNums = StringRegExp($sLine, "(?:Hex\s\d{2}:\s)(\A+)", 1)
MsgBox(0, "Numbers", $aLineNums[0])

Share this post


Link to post
Share on other sites

You might want to take a look at an attempt to get an embedded browser to work as an Edit control explained here:

_HyperEdit

WARNING!!!

ONLY ALPHA -1001

Not even tested it myself besides what's posted.

IVAN

Your last two post have had nothing to do with this topic. If you are trying to advertise your script, post it in the Scripts and Scraps Forum!

Share this post


Link to post
Share on other sites

It would help if you would post exactly what you are wanting to match the first time.

$sLine = "|Hex 01: 6A5E1F8                 |"
$aLineNums = StringRegExp($sLine, "(?:Hex\s\d{2}:\s)(\A+)", 1)
MsgBox(0, "Numbers", $aLineNums[0])
yes sry first i thought there would be a function like FileReadFromCharToChar or something like that

but after u showed me this function i saw that it doesnt work with from to

it is working now and i just took again a look to the helpfile to understand what u wrote there... thx for your help

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0