Jump to content
Sign in to follow this  
ChrisL

StringRegExp Question

Recommended Posts

ChrisL

Can someone tell me how you would get the data from this "NegNumber=\\DPC201\JobQ\A10301\Media01\99991-R1-22-14A_009_023_023.jpg"

I want everything after NegNumber= the thing is, it could be any path not always a UNC path it could be local D:\ it may not end with .jpg the only thing I know is it definately has "NegNumber=" I can't read it as an ini file as there are lots of NegNumber= in the text file.

All I have is this but all it returns is NegNumber= (which I know it should but) I need the oposite to the end of the line

$NegNos = StringRegExp(FileRead("a10301.txt"),"(?i)NegNumber=",3)

ANy help please thanks

Share this post


Link to post
Share on other sites
evilertoaster

dk 'bout regexp but this should work too-

$NegNos = StringReplace(FileRead("a10301.txt"),"NegNumber=","")

Share this post


Link to post
Share on other sites
ChrisL
/dev/null

Can someone tell me how you would get the data from this "NegNumber=\\DPC201\JobQ\A10301\Media01\99991-R1-22-14A_009_023_023.jpg"

I want everything after NegNumber= the thing is, it could be any path not always a UNC path it could be local D:\ it may not end with .jpg the only thing I know is it definately has "NegNumber=" I can't read it as an ini file as there are lots of NegNumber= in the text file.

All I have is this but all it returns is NegNumber= (which I know it should but) I need the oposite to the end of the line

$NegNos = StringRegExp(FileRead("a10301.txt"),"(?i)NegNumber=",3)

ANy help please thanks

Is there other content on the line(s) which contain the string "NegNumber=xxxxx" ??


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites
ChrisL

This is a bit from one of them only @crlf I guess

[Neg]

NegNumber=\\DPC201\JobQ\A10301\Media01\99991-R1-22-14A_009_023_023.jpg

Retouch=0

Orient=0

Crop=

FKComp=0

FKEdit=0

Optimize=y

[unit]

Code=4x6 prints

Qty=1

Color=C

[Neg]

NegNumber=\\DPC201\JobQ\A10301\Media01\99991-R1-23-13A_008_024_024.jpg

Retouch=0

Orient=0

Crop=

FKComp=0

FKEdit=0

Optimize=y

[unit]

Code=4x6 prints

Qty=1

Color=C

Edited by ChrisL

Share this post


Link to post
Share on other sites
SmOke_N

_PathSplit() probably would have worked... ?

#include <array.au3>
$sString = 'NegNumber=\\DPC201\JobQ\A10301\Media01\99991-R1-22-14A_009_023_023.jpg'
$aArray = StringRegExp($sString, 'NegNumber=\\+(.*?)$', 1)
_ArrayDisplay($aArray)oÝ÷ ØGbµ*+¯"+y§b·
èajÛ!¢é]ër¢ç¯z¼­)àiû^¬× 6ézoÝ÷ ÚÈhºWp¢¹v+v
©§"k¬¶·¡j÷¢¶Ç+{º!jܨ»§µ«­¢+Ø¥¹±Õ±ÐíÉÉä¹ÔÌÐì(ÀÌØíÍMÑÉ¥¹ôÌäí99ÕµÈôÀäÈìÀäÈíAÈÀÄÀäÈí)½DÀäÈíÄÀÌÀÄÀäÈí5¥ÀÄÀäÈìääääĵHÄ´ÈÈ´ÄÑ|ÀÀå|ÀÈÍ|ÀÈ̹©ÁÌäì(ÀÌØíÉÉäôMÑÉ¥¹IáÀ ÀÌØíÍMÑÉ¥¹°Ìäí99ÕµÈô ÀäÈìÀäÈ쬸¨ü¤ ý´èÀäÈíÉðÀÌØì¤Ìäì°Ì¤)}ÉÉå¥ÍÁ±ä ÀÌØíÉÉä¤
Another alternative. Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
ChrisL
/dev/null

This is a bit from one of them only @crlf I guess

[Neg]

NegNumber=\\DPC201\JobQ\A10301\Media01\99991-R1-22-14A_009_023_023.jpg

Retouch=0

Orient=0

Crop=

FKComp=0

#include <File.au3>

$file = "47495.txt"

dim $lines
_FileReadToArray($file,$lines)

for $i = 1 to $lines[0] 
    $match = StringRegExp($lines[$i],"^NegNumber=(.*)$",1)
    if IsArray($match) Then
        MsgBox(0,"",$match[0])
    EndIf
next

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

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  

×