Get Nth character with Sed

sed, string

Solution

You don't need `sed` for that. You can use `bash` string substitution:

$ book="The Ancients in History"
$ book="${book// /}"   # Do global substition to remove spaces
$ echo "${book:13:1}"  # Start at position 13 indexed at 0 and print 1 character
H

Problem

I'm in the middle of Playing Final Fantasy 7, and I'm at the part where you're in the Library at Shinra HQ and you have to write down the Nth letter--minus the spaces, where Nth is the number in front of the book's title--for every book that doesn't seem to belong in the current room, of which there are 4. I need a sed script or other command-line to print the title of the book and get the `Nth` letter in its name.

Original source