I have a text file in which the data has the form:
Number of Iterations: 150
Average time is 45 ms
Average time for collisions is 50 ms
Total time is 95 ms
....
There are several files of this type. I have to read all these files and create a csv file that will contain the form entries:
150,45,50,95
200,40,60,100
...
...
where each line corresponds to one txt file.
I am writing a bash script to generate a CSV file from this data.
I want to read only the numbers from a text file.
For the first line, I tried to use
IFS =": " read w1 w2
But it breaks the line using space as well as a delimiter along with ':'
When I used
IFS=":"
150, .
?
"is" . ?