seperating text
Moderators: JRL, Dorian (MJT support)
seperating text
I would like to find a way to seperate text from a line. I am using a scrip that returns the a value of:
6_lotid_V703585G
The "6_lotid_ " is always the same and i don't need that part. I need the V703585G part of this value. Is there a way to do this?
I was thinking of
let>6_lotid_=
but this didn't work
Any help Thanks
6_lotid_V703585G
The "6_lotid_ " is always the same and i don't need that part. I need the V703585G part of this value. Is there a way to do this?
I was thinking of
let>6_lotid_=
but this didn't work
Any help Thanks
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Or if the position of 6_lotid_ is not predetermined you can use:
let>line=6_lotid_V703585G
Separate>line,6_lotid_,values
MessageModal>values_2
Or
let>line=6_lotid_V703585G
Pos>6_lotid_,line,1,p
Let>s=p+8
Length>line,l
MidStr>line,s,l,value
let>line=6_lotid_V703585G
Separate>line,6_lotid_,values
MessageModal>values_2
Or
let>line=6_lotid_V703585G
Pos>6_lotid_,line,1,p
Let>s=p+8
Length>line,l
MidStr>line,s,l,value
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
You could also do this since the first part is always the same
Code: Select all
let>line=6_lotid_V703585G
StringReplace>line,6_lotid_,,Result
MessageModal>Result
Last edited by Rain on Tue Feb 27, 2007 1:10 pm, edited 1 time in total.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Macro Scheduler is like a cat - there are lots of ways to swing it 

Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Great ideas here. But here is another test for you lol.
ok in the text files i am searching there are any where from 50 to 10,000 lines of text. I know that my last value i want to retreave is only 5 away from the bottom. is there a way for it to jump to the bottom of the page and work up.
any Ideas lol.
ok in the text files i am searching there are any where from 50 to 10,000 lines of text. I know that my last value i want to retreave is only 5 away from the bottom. is there a way for it to jump to the bottom of the page and work up.
any Ideas lol.

- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Yes, but there's not really a performance gain compared with reading from the top, since you have to determine the number of lines first. You can do it like this:
But I wouldn't recommend this for large files - it could be quite slow because it reads the entire file into memory. In this case you'd actually be better off reading one line at a time.
You can do it with lower level programming languages by setting the file pointer to the end and reading backwards, counting the line terminators as you go. MacroScript can't do this. Actually you can probably do this in VBScript, but it will require more advanced code.
Code: Select all
Let>file=c:\test.txt
ReadFile>file,fileText
Separate>fileText,CRLF,lines
Let>5th_From_Bottom=lines_count-5
Let>theline=lines_%5th_From_Bottom%
MessageModal>theLine
You can do it with lower level programming languages by setting the file pointer to the end and reading backwards, counting the line terminators as you go. MacroScript can't do this. Actually you can probably do this in VBScript, but it will require more advanced code.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?