I know this is a very common question. But I’ve looked through SO and google but I’m still unable to remove the first occurance or first few characters of a string which I retrieved from mysql.
I’ve got a table like this.
Name | Age
James| 27
My sql query (Select name from Human)
Once I execute the command from my bash script, it retrieves the row name (Name) and entry (James) in this form Name James when I only need James. How do I remove the word Name (including the space after it)? I want to store the result in a string and not echo it.
I think what you want is the mysql command line option
--skip-column-nameswhich will prevent the first line containing the column names to be returned with theSELECTquery. Try that.