Non macro way to determing if posix (/) or windows-nt (\) folder-path separator is used?

The pyhton equivalent is import os; os.sep
Folder1+ os.sep + Subfolder2 + os.sep + mainfile.txt

Best improvisation I’ve come up with is:
=ISNUMBER(FIND("\",A2))

This assumes user has already specified their file paths somewhere else.

Hallo
In python it doesnt matter, you should always use /slash:

from pathlib import Path
p = Path.home() / "folder" / "subfolder" / "mainfile.txt"

but anyway:

=IF(INFO("system")="WNT";"\";"/")
1 Like

It doesn’t matter everywhere. The forward slash can be used on Windows in other places as well. They are only prohibited in a very limited set of APIs (and in cmd.exe), but definitely not in LO.

Thank you for the answer. I’d like to add Excel uses ‘pcdos’ instead of ‘WNT’, for those interested.
=IF(OR(INFO("system")="WNT", INFO("system")="pcdos"),"\", "/")

1 Like