Posted By

brm on 01/08/18


Tagged

Bash linux scripting


Versions (?)

join-chars--newline-file


 / Published in: Bash
 

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

  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  

You need to login to post a comment.