To encode the text do the following steps.
1)grep -f regularexpressionfile junkdatafile1>result1
- The regularexpressionfile and result1 file should have equal number of lines.
- regularexpressionfile cant begin with "^".
3)grep -vf regularexpressionfile junkdatafile2>junkdatafile3
4)paste -d"\n" result2 junkdatafile3>encryptedtext
To decode the text do the following
1)grep -f regularexpressionfile encryptedtext|cut -c 1