Created a CSV_type_file with Python(Review)

Hello,I watched a code snippet online where a CSV_file is created using some list implementation,so recreated the code using my own implementation.But along the development of the algorithm,I didn’t think of time complexity as I used at least 3 loops,the code also looks a it untidy,but I tried my best to recreate the code.So here’s the code.This code is completely different from which I saw.Do review this if possible.
If you find it difficult to understand ,i’ll comment the code.

val = "Index,Name,age,0,Sai,22,1,Venkat,22,2,Nikhil,22"


def csv_file(val):
    return val.strip().split(',')

#print(csv_file(val))

new_arr_2 = []
power_arr = []
end_count_list = []

def convert_to_csv(result):
    new_arr = list(reversed(result))
    #print(new_arr)

    count = 0
    while new_arr[count] != "age":
        new_arr_2.append(new_arr[count])
        count = count + 1
            
    for i in range(0,len(new_arr_2)):

        if len(new_arr_2[i]) >= 3:
            #print(i)
            new_arr_2[i] = str(new_arr_2[i])
        else:
            #print(i)    
            new_arr_2[i] = int(new_arr_2[i])
    
    new_arr_3 = list(reversed(new_arr_2))    
    
    new_arr_3.insert(0,"age")
    new_arr_3.insert(0,"Name")
    new_arr_3.insert(0,"Index")
    
    start_count = 0
    end_count = 3
    for b in range(4):
        #print(new_arr_3[start_count:end_count])
        end_count_list.append(new_arr_3[start_count:end_count])
        start_count = start_count + 3
        end_count = end_count + 3

    return end_count_list

print(convert_to_csv(csv_file(val)))