I have an array where each each array is in this format "path of the file :number: content in one line".
i want to read each line and create different files(.txt) in one directory. If the path is same, i will append it to the old file else create a new file?
input : example it's in the format of file path: line number : comment
a-tests/right/case1: 12 : //comment
-tests/right/case1: 13 : //comment
-test/right/case3: 5 : //comment
expected output :
in each file there should be the same path and the whole line should be printed. If the path is different then i should create a new file.