Hello I need to do a function that reads from a text file and returns me a new text file with a calculation Average max and min

Each line in the file includes a location after ' : '
There are real numbers that are forded by a sign ' , '

for example:
This my text file

Bulgaria:
France:23.4,6.4,-6,22
Germany:12,23.3,14,25
Spain:-5,12,4,12.3,7,12
Portugal:23,7.x
Romania12,23.3,14,25

and this what i need output in new text file

Bulgaria:no temperature
France:avg(11.45),min(-6.0),max(23.4)
Germany:avg(18.575),min(12.0),max(25)
Spain: avg(7.05),min(-5.0),max(12.3)
Portugal:23,7.x temperature error
Romania12,23.3,14,25 line error beacuse not have ' : '

how i can do this ?

Let's see your work so far as well as you telling us where you are stuck. If you need to outsource this work, tell how much you are paying.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.