I would like to add a column to my csv file that contains the same data for all rows
my csv file :
sugar, 150, stock
salt, 30, stock
milk, 30, stockout
my file after adding the row (expected result):
product, sugar, 150, stock
product, salt, 30, stock
prouct, milk, 30, stockout
I want to add the field "product" to each line, my code :
const writestream = fs.createWriteStream("file.csv", {
flags: 'a'
});
writestream.write("," + "product");
This returns product at the end of the file, How can i fix it
can I use the fast-csv library to add this field?