\s
does not seem to work with
sed 's/[\s]\+//' tempfile
while it is working for
sed 's/[ ]\+//' tempfile
I am trying to remove white spaces that are coming at the beginning of each line due to the command:
nl -s ') ' file > tempfile
e.g. file:
A Storm of Swords, George R. R. Martin, 1216
The Two Towers, J. R. R. Tolkien, 352
The Alchemist, Paulo Coelho, 197
The Fellowship of the Ring, J. R. R. Tolkien, 432
The Pilgrimage, Paulo Coelho, 288
A Game of Thrones, George R. R. Martin, 864
tempfile:
1) Storm of Sword, George R. R. Martin, 1216
2) The Two Tower, J. R. R. Tolkien, 352
3) The Alchemit, Paulo Coelho, 197
4) The Fellowhip of the Ring, J. R. R. Tolkien, 432
5) The Pilgrimage, Paulo Coelho, 288
6) A Game of Throne, George R. R. Martin, 864
i.e. there are spaces before numbers
Please explain why the white spaces are coming and the reason for \s
to not work.