William Devlin is alleged, while clad in a mask, to have threatened a shop assistant at the Premier Store in Scott Street in Galashiels and demanded money, though he then left empty-handed.
That offence is said to have been committed on Sunday, August 2, at around 3.35pm.
Devlin, of Howdenbank in Hawick, appeared in private at Edinburgh Sheriff Court yesterday, August 3, charged with attempted robbery and possession of a pointed article in a public place.
He made no plea, and the case was continued for further examination.
Devlin was remanded in custody and will appear in court again next week.