I have a lot of dgn files and don’t know which are V7 and which are V8. Is there a way to quickly and easily tell them apart? I would hate to have to go through and open them up individually.
Do you know how to use PowerShell? I wrote a PowerShell function that will give a file's magic number (https://en.wikipedia.org/wiki/Magic_number_(programming)#In_files) and if it recognizes the magic number the file type. It can recognize V7 and V8 files.
The function is on GitHub here: Get-MagicNumber on GitHub
Put that function in a file, then open PowerShell and do:
. filename.ps1
where the first character is period, then space, then the name of the ps1 file you put the function in.
Once you've done that you can cd to your folder of files and do the following:
dir *.dgn -recurse -file | Get-MagicNumber | Format-Table File,FileType Where: -recurse means to get all *.dgn files in the current folder and sub-folders -file means only return info about files
You can also use the Export-Csv command instead of Format-Table to send the info to a CSV file instead of the screen.
can you explain this a bit better not good with poweshell
Kevin van Haaren said:Put that function in a file, then open PowerShell and do: . filename.ps1
Lorys
Started msnt work 1990 - Retired Nov 2022 ( oh boy am I old )
But was long time user V8iss10 (8.11.09.919) dabbler CE update 16 (10.16.00.80)
MicroStation user since 1990 Melbourne Australia.click link to PM me