I have csv file like this:
No, Date, Expr 11, 2013, 5413 24, 2014, 1234 ... I have bash script and check no, date and expr values, print to csv files:
echo -e "No, Date, Expr" > "file.csv" echo -e "$no, $Date, $Expr" >> "file.csv" echo -e "$no2, $Date2, $Expr" >> "file.csv" ... But I need to check old data and if new value is same or new value is empty, i must not write anything. For example: if $no2=24 and old no2 in csv file is 24 too, i must not echo.
So I need to check and echo specific line. I can check values and compare new value. But how can I insert for example just 3. line 2. value in csv file with bash?
">" create new file, so its delete everything. ">>" echo last line, so its insert new values, new lines.
Csv file must be static, just values must be dynamic. How can I do?