I want to print everything starting from # till line ends.
can you please help me how to do that??
I am trying in perl, able to parse "#......." pattern but not able to understand how to make it print??
Or you could split each line on "#" as the delimiter, assign the chunks to an array and print just the 2nd element of the array -
$
$ perl -lne '@x = split/#/ and print $x[1]' f31
GTTAATANTTGGGTTTTCT
GTTANTTGGGTTTTCT
CTNTTGGGTTTTCT
$
$
$ # Or more succintly...
$
$ perl -lne 'print ((split/#/)[1])' f31
GTTAATANTTGGGTTTTCT
GTTANTTGGGTTTTCT
CTNTTGGGTTTTCT
$
$ # Or even more succintly...
$
$ perl -plne '$_=(split/#/)[1]' f31
GTTAATANTTGGGTTTTCT
GTTANTTGGGTTTTCT
CTNTTGGGTTTTCT
$
$
Or you could even find out the index of the "#" character in each line, extract the substring of each line that starts from that index onwards, and then print that substring, like so -