I have a data file called 'frequency.txt' in two columns, column 1 is 'frequency' it is a number showing a repetition of corresponding column 2 which has ids .
32 329 312 330 320 331 132 332 232 334 52 336 42 337 82 338 .. ...
The above data has to be updated in a column in a mysql database. There are more than 100 lines and everyday I have to update it. Right now I am using this command to update it manually.
echo ' update table.id_set set 'frequency' = 32 whereid
=329; '|mysql -B -u username -p -h database.com
How to write a shell script which will automatically replace the value of 'frequency' and 'id' in the above echo command and run it for all the existing lines in the frequency.txt
PS:- The number of lines in the frequency.txt will be different.