Utilizing json-2-csv in a node application to update a specific value on row 1. Attempting to locate the Header "B" and swap out the value "2" with "7" using the following code:
var C = "B"
csvfile[itr].C = "7"
Here is the original csv file:
A, B, C
1, 2, 3
The resulting output is as follows:
A, B, C
1, 2, 7
The desired output should be:
A, B, C
1, 7, 3