Skip to content

Instantly share code, notes, and snippets.

@RobinRamael
Created February 24, 2011 11:31
Show Gist options
  • Select an option

  • Save RobinRamael/842070 to your computer and use it in GitHub Desktop.

Select an option

Save RobinRamael/842070 to your computer and use it in GitHub Desktop.
1 {
h
d
}
/^[A-Z]/{
G # append the hold space
s/\([A-Z]\)\n/\1/ # put what was in the hold space on the same line
s/\([A-Z][0-9]\).*$/\1/ # remove all but the first two chars
x # now we're going to work on the hold space
s/^.\(.*\)$/\1/g # delete the first char
x # put everything as it was
# now we should have each letter withn it's corresponding number on each line
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment