Using awk to print characters of specific index on a line May 27, 2023 by Tarik awk '{print substr($0,2,6)}' file the syntax for substr() is substr(string,start index,length)