The simplest trick for this data set is processing the second column - the version number.
$ cat Data3 | sort -k2,2V -t'|' Help Text|50001/100/7 My Message|50001/100/7 Visible Text|50001/100/52 Text Message|50001/100/63 Invisible Text|50002/100/1 Help Message|50002/100/11 My Text|50002/100/43
However, this does not always work depending on your input. This will work because the values ββin the second column are the same.
You could do what fedorqui suggested and run the sort twice, and the second time you make a stable look. From manpage: -s, --stable (stabilize sorting by disabling last resort comparison)
First sort by secondary sorting criteria. Then create a stable view that preserves the sort order in rows that use the same key from the main sort criteria.
$ cat Data3 | sort -k3,3n -t'/' | sort -k2,2n -t'|' -s Help Text|50001/100/7 My Message|50001/100/7 Visible Text|50001/100/52 Text Message|50001/100/63 Invisible Text|50002/100/1 Help Message|50002/100/11 My Text|50002/100/43
In this case, you're in luck, since -k2,2n -t ββ'|' will treat the second column β50001/100/7β as a number, which is likely to be 50001. You may find yourself in strange situations if it were separated by commas rather than a slash, and you used a different language in your environment. For example, by default in my environment, I run en_US.UTF-8, which behaves as follows.
$ cat Data3 | tr '/' ',' | sort -k3,3n -t',' | LC_NUMERIC=en_US.UTF-8 sort -k2,2n -t'|' -s Help Text|50001,100,7 My Message|50001,100,7 Invisible Text|50002,100,1 Visible Text|50001,100,52 Text Message|50001,100,63 Help Message|50002,100,11 My Text|50002,100,43
What do you expect from this:
$ cat Data3 | tr '/' ',' | sort -k3,3n -t',' | LC_NUMERIC=C sort -k2,2n -t'|' -s Help Text|50001,100,7 My Message|50001,100,7 Visible Text|50001,100,52 Text Message|50001,100,63 Invisible Text|50002,100,1 Help Message|50002,100,11 My Text|50002,100,43