Richard Gardner
asked on
Copy data from one CSV into another line by line
I have two slightly different CSV's -
File1.csv = Contains columns ID, Date, Total (with correct Total data)
File2.csv = Contains columns ID, Date, Total (with incorrect Total data) and many other columns containing data
I want to end up with File3.csv with data from File2.csv but for each line in File2.csv I want to copy the corresponding data in 'Total' column from File2.csv.
Each line in File1.csv and File2.csv have the same data in ID and Date columns.
I have been desperately trying to use Loops within Loops to try and match records with no success. Is there an easy way of doing this line by line?
File1.csv = Contains columns ID, Date, Total (with correct Total data)
File2.csv = Contains columns ID, Date, Total (with incorrect Total data) and many other columns containing data
I want to end up with File3.csv with data from File2.csv but for each line in File2.csv I want to copy the corresponding data in 'Total' column from File2.csv.
Each line in File1.csv and File2.csv have the same data in ID and Date columns.
I have been desperately trying to use Loops within Loops to try and match records with no success. Is there an easy way of doing this line by line?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That seems to be a one-off, where speed doesn't matter that much. The "Where" query is more about the learning curve for "I have been desperately trying to use Loops within Loops to try and match records".
ASKER
Thanks - works perfectly. Unfortunately the goal posts have moved with what I am trying to achieve due to the data being provided.
I will start another post.
I will start another post.
Open in new window