Count the repeating number of subsequent lines

IBM's Command List programming language & Restructured Extended Executor

Count the repeating number of subsequent lines

Postby REXXLearner » Sat Oct 11, 2008 4:52 am

Hello everyone,
i am brand new to RExx and its concepts
I was given a file full of different lines. I had to read a little part of them let say only five lines from particularly indicated line number .......that part works for me just's what i have:

fileid = 'TEST TXT A'                       
nlines = LINES(fileid)                           
say "There are: " nlines "lines in total."       
say LINEIN(fileid,22,1)                     
Do 5                                             
        say LINEIN(fileid)                           

This code here starts off with line 22 and prints out consecutive 6 lines. So how can i modify this code so that in this particular piece of 6 lines i could count the number of successive repetitive lines. So if the same line repeats itself on the next line i would have a message like:

the line: (line) repeats (x) times in this section

any help is appreciated
Posts: 1
Joined: Sat Oct 11, 2008 4:34 am
Has thanked: 0 time
Been thanked: 0 time

Re: Count the repeating number of subsequent lines


Return to CLIST & REXX


  • Related topics
    Last post