How to convert output from the Unix GNU find command (on Windows Cygwin) to something dopus can use?

Windows 10 Pro
cygwin (bash shell)

I have the output of a find command (Unix GNU find command) that was run on cygwin

The results look like this:


Where the /d is really drive D:\ on windows

The find command finds files recursively and sorts in order of file creation descending (most recent file created first)

Now I want to convert the output (in a file called results.txt) to something I can open in dopus

where dopus would read the file and provide me with an icon for each file that I can double click and open, or drag and drop to the secondary pane for sorting

The following command will not exactly work because the output is in POSIX format with forward / slashes instead of backward \ slashes (windows style path), and there is no D:\ drive indicator in the output file, but rather is like as mentioned above: /d/some/path/to/file.txt

$/dopusrt.exe /col import /create /utf8 "opus-files" ./results.txt

I am typing this command in cygwin bash (on Windows)

How would I get this to work to create a file or some sort of object that can be opened in dopus?

Where does 'dopusrt.exe' put the output of the command?

You'll need to convert the paths so they're valid.

It probably doesn't matter if they use \ or / but no Windows software will understand /d instead of D:\

It creates a file collection that you can view inside of Opus.

What does your find command look like?

When testing this -- using Cygwin's own find command -- this resulted in a result.txt like below:

c:\program files\directory opus
c:\program files\directory opus/d8viewer.exe
c:\program files\directory opus/Viewers
c:\program files\directory opus/x86

And that could be opened as an Opus collection without issues, even though results.txt has no CRLF but LF line endings.

I am not using Windows find command, but rather the GNU find command that you typically find on Unix / Linux systems.

It is significantly more powerful than just about anything out there.

I am using "cygwin" on Windows which provides me with a bash shell as if I were using a Unix / Linux shell.

the output looks like this:


Where /d is the D:\ drive

/c/some/path/to/a/file could indicate that it's on the C:\ drive

I cannot open files in dopus because I do not have a license key - my trial has expired and when I request a new trial key I do not get an email.

If I can get this to work, where I can write a bash script to find files based on certain criteria and then open that list in dopus, I will make a purchase.

The one problem I have with dopus, is that if I set up any type of search criteria, the search criteria is not saved and not easy for me to retrieve.

dopus will not save the source directory for any given search. It goes away on shut down or some action.

I cannot create a named search and save that, and then run that and work with the results.

I need to be able to save the full search criteria script and re-run it when I want or create another search criteria and save that (including the source directories that are searched as part of the save search criteria - I'm not seeing that dopus does that).

And so that is fine, OK, not a problem. I will create a bash script that I save in a file that I can run, it will output to a single file of the files found that I need to open in dopus and I'm good to go.

If I can get a trial license key sent, and prove this out, I will make a purchase.

Here is an example of the find command that I use:
find ${DIR} -type f -print0 | xargs -0 stat --format '%Y :%y %n' | sort -nr | cut -d: -f2- | tee notes-desc.txt

I will then further process to cut the fields that contain the time stamp out (that is needed for sorting by order of creation that I need), but you can see that the file path is like: /d/some/path/to/a/file.txt

This cuts out the timestamp and only displays files in a posix path format (forward slash with the first 2 characters being the windows drive)

find ${DIR} -type f -print0 | xargs -0 stat --format '%Y :%y %n' | sort -nr | cut -f 5 -d " " | tee notes-desc.txt

like /d means D:\

I did expect this response ... :smiley:

See also the screenshot. Here you will find proof that Cygwin's find has been used.

So I wondered where your /d/... syntax came from; I am seeing a different output format.

Anyway, you can use the sed command to shape the output in the desired form (note that I slightly changed your commands; should give the same results)

find "c:\\some folder" -type f -printf '%T@|%p\n' | sort -r | cut -d '|' -f 2 | sed 's|^/\(.\)/|\1:/|'

The resulting format -- c:/some folder/directory/filename.txt -- in results.txt can be used in Opus straightaway.

@devlocal :
You are not one of those hit-and-run people, are you?

You asked a question, someone took time to figure some things out for you and ... deafening silence.

I hope you won the lottery, bought a tropical island and enjoy your stay over there (but without internet connection yet).
If not: Reply.