Pring starting and ending numbers using UNIX

Hi all,

I need to do scrip for printing starting and ending numbers along with count in given file.:wall:

Input: a.txt

10000030
10000029
10000028
10000027
10000026
10000024
10000023
10000021
10000018
10000018
10000017
10000016
10000015
10000014
10000013
10000011
10000010
10000009
10000008
10000006
10000005
10000004
10000003
10000002
10000001

Output needed : out.txt

starting,Ending,count

10000001,10000006,6
10000008,10000011,4
10000013,10000019,7
10000021,10000021,1
10000023,10000024,2
10000026,10000030,5

Plz help me to solve this scrip:confused::confused::confused::confused::confused::confused::confused::confused::confused:

Is this a homework assignment?
If it isn't homework, what is the reason for needing to do this?

In this sample, the input is in reverse sorted numeric order. Will that always be true with your input data?

Will the input always only be 8 digit numbers?

Hi Don,

Thanks for your reply...

Yes this is for my UNIX class work. my teacher ask me to do some scripts.so i try this but i struck....

Input will not be arranged as above it be in any kind of order and we ll use sort command to sort in wanted format..

No, my input digit is up to 0 to 12 digits some time..