so i have a data file that has various lines which may or may not end with spaces or tabs.
data.file:
[hello], \t \t
{sample} <spaces> <spaaces> several more spaces....
{"resemble"}, <nospaces>
Command i'm using:
sed -n 8p data.file | egrep "\],$|\],\ $"
or
egrep "\],$|\],\ $" data.file
basically, i just want to make sure there are no additional characters after the string that i specify to egrep. so in the above code, i'm telling egrep to only grab lines that end in any one of the following:
], <nospaces>
], <spaces>
my problem is, there is no way for me to know what comes after the string i'm searching for. there maybe multiple tabs, there may be no tabs, there may be one tab, there may be no spaces, there may be many spaces, or one. i have no clue.
what i need is to be able to modify the egrep command so that i get an output as long as no other character (except tabs or spaces) comes after the specific characters i provided to egrep.