/ Published in: Bash
Save to your folder(s)

join characters inside file by extracting keyword which separate by newline and special characters by including desired numbers characters on right and left

Copy this code and paste it in your HTML
  1. # i used hexdump to find out the special characters
  2. # hexdump -c file
  3. # below commands will extract the pattern include 100 characters on right and left from the keyword pattern
  4. tr -d '[[:space:]]' < file | grep -o '/\{0,100\}PATTERN.\{0,100\}'

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.