An Army officer who was stabbed multiple times near a barracks has thanked the “overwhelming” generosity of strangers as nearly £50,000 has been raised to support him and his family in recovery.