---- add "\hline" in the begining of each line in a file one_year_stat
sed 's/^/ \\hline /' one_year_stat > tt
---- add "\" in the end of each line in a file:
sed 's/$/ \\/' tt
---- add " &" in the end of each line in a file:
sed 's/$/ \&/' tt
sed 's /\(.*\)& /\1 /' one_year_stat
set aa = /home/user/tt
sed "s|^|${aa}|g" txt_file
NOTE: For special characters such as \ or &;, if we want to add then in the text file using the sed. We need put \ before them such that they may be added in the file.
Aucun commentaire:
Enregistrer un commentaire