0

Currently, I don't seem to be able to find a script or guide online to find out how to extract the hash:salt into a text file.

For example

user,7,17,email,alis,,,b8e44d9a607d0c547294b24eac45399:tEleOY91IV7IKVqzqlp21sbmeuEFpU68,0,252dc07d557dfd2185603a8c2fe4cd94,2019-03-28 19:15:47.0 

I came across Extract paired lines which kind of helped but didn't achieve what I was looking for.

I am trying to extract the b8e44d9a607d0c547294b24eac45399:tEleOY91IV7IKVqzqlp21sbmeuEFpU68 section.

Kusalananda
  • 333,661

1 Answers1

1

Your sample data appears to be comma-separated, with the desired text in the 8th field. If the text you want is always going to be in the 8th field, you can use awk -F, '{print $8}'. For example:

echo "user,7,17,email,alis,,,b8e44d9a607d0c547294b24eac45399:tEleOY91IV7IKVqzqlp21sbmeuEFpU68,0,252dc07d557dfd2185603a8c2fe4cd94,2019-03-28 19:15:47.0" | awk -F, '{print $8}'
b8e44d9a607d0c547294b24eac45399:tEleOY91IV7IKVqzqlp21sbmeuEFpU68
cas
  • 78,579