read line ?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
carkon
Newbie
Posts: 13
Joined: Sun Sep 26, 2010 9:36 am

read line ?

Post by carkon » Wed Jun 29, 2011 12:54 pm

hi everybody..
i have number.txt file its like this

13425
54678
2346
74567
75756
32432
56856 there are numbers each line

i want to separete second and third number to another txt i mean


13425 --> give me 34
54678 --> 46
2346 -->34
74567 -->45
75756 -->57
32432 -->24
56856 -->68


can i do this ?

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Wed Jun 29, 2011 1:20 pm

From the Help file ------------------------

MidStr>string,start,length,result

Returns a substring of specified length from a given position in a string. result is a variable in which to store the returned string. Any parameter can be a variable containing the appropriate values.

Abbreviation : Mid

See also: Position, ConCat, Length

Example

In the following example, the variable somevalue becomes equal to 'Happy' :

MidStr>Happy Birthday,1,5,somevalue
Message>somevalue

carkon
Newbie
Posts: 13
Joined: Sun Sep 26, 2010 9:36 am

Post by carkon » Wed Jun 29, 2011 2:20 pm

thank you but i am still not solved my problem ...thanks again

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Wed Jun 29, 2011 2:26 pm

i want to separete second and third number to another txt i mean

13425 --> give me 34

Code: Select all

MidStr>13425,2,2,somevalue
Message>somevalue

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Wed Jun 29, 2011 2:52 pm

how can i use this formula

MidStr>13233,2,2,somevalue

for lots of number.because ý have 20000 line..and i have to write to another txt

Code: Select all

  Let>k=1
Label>start
  ReadLn>c:\number.txt,k,line
  If>line=##EOF##,finish
  If>line=,finish
  MidStr>line,2,2,outvalue
  WriteLn>c:\new_number.txt,result,%outvalue%
  Let>k=k+1
  Goto>start
Label>finish

carkon
Newbie
Posts: 13
Joined: Sun Sep 26, 2010 9:36 am

Post by carkon » Wed Jun 29, 2011 4:15 pm

thank you very much

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts