Replace index by line