Hi,
I have information about 12340 cars. This info is stored sequentially in two different files:
- car_names.txt, which contains one line for the name of each car
- car_descriptions.txt, which contains the descriptions of each car. So 40 lines for each one, where the 6th line reads @CAR_NAME
I would like to do in python: to add for each car in the car_descriptions.txt file the name of each car (which comes from the other file) in the 7th line (it is empty), just after @CAR_NAME
I thought about:
1) read 1st file and store car names in a matrix/list 2) start to read 2nd file and each time it finds the string @CAR_NAME, just write the name on the next line
But I wonder if there is a faster approach, so the program reads each time one line from each file and makes the modification.
Thanks