Sed - Numbering lines
Numbering lines (equat to "cat -n file.txt") sed = file.txt
The problem is that the display is effected on 2 lines. To set this default:
sed = file.txt | sed 'N;s/\n/\t/'
Number the lines but only the numbers of non-blank lines.
sed '/./=' file.txt | sed '/./N;s/\n/ /'
Counting the number of lines (equal to "
wc -l file.txt | awk '{ print $1 }'")
sed -n '$=' fichier.txt
Defining the line number containing a reason
sed -n '/Début/=' fichier.txt
The setting= "accepts only one address, to define the numbers of lines between 2 reasons, use the following syntax
sed -n '/Début/,/Fin/{=;d;}' fichier.txt