SDR# Convert Frequency Manager Suite Fmsuite Database to FreqMan frequencies.xml

Status
Not open for further replies.

jdolina

Member
Premium Subscriber
Joined
Jul 4, 2006
Messages
510
Reaction score
43
Location
Lorain Ohio
Thought this might help someone. I was trying to run SDR# 1785+ but Fmsuite no longer works. I have been wanting to try FreqMan (wraiths frequency manager) but have thousands of frequencies in the FreqMgr.db. Using a database browser and some powershell I was able to convert the database entries to xml. I looked around and didn't find anything else to do this. But I now have my frequencies in Frequency manager and I am running SDR# 1793

YMMV

backup your frequencies.xml file in your sdrsharp directory.
You need to delete or rename your current frequencies.xml file in your sdr directory

Download the following SQL database browser DB Browser for SQLite

open your freqman.db file

Run this sql from the execute sql tab

*******SQL is below this line**************************************************************
select Data.Frequency, Data.Description as Name, Data.Mode as DetectorType, Data.Shift, Data."Filter Bandwidth" as FilterBandwidth, Groups.Name as GroupName from data
join GroupFreq on Data.Id = GroupFreq.FreqId
join Groups on GroupFreq.GroupId = Groups.Id
order by Groups.Name;

**********SQL is above this line***********************************************************

Export the output to a CSV file [little icon with down arrow above output]

Windows 10 powershell can be run right clicking the windows menu and picking windows powershell

Save the powershell below as convert.ps1
If you want the scan option checked for each entry remove the # in the beginning of the two outScan entries



run from powershell the command below (you may need to enable scripts by running powershell as admin and issuing the command set-executionpolicy remotesigned)
./convert.ps1 [input csv file] [output xml file]

The output file should be [your sdr directory]\frequencies.xml
The input file is the CSV file you saved above.

*******************convert.ps1 is below this line***********************************************************************************
$param1=$args[0]
$param2=$args[1]

$FREQMAN = Import-Csv $param1
$outFile = $param2

$XMLHeader1 = "<?xml version=""1.0""?>"
$XMLHeader2 = "<ArrayOfMemoryEntry xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">"

Write-Output $XMLHeader1 | Add-Content $outFile
Write-Output $XMLHeader2 | Add-Content $outFile

foreach ($FREQMAN in $FREQMAN) {

$outMem = "<MemoryEntry>"
#$outScan = " <IsScanned>true</IsScanned>"
$outFav = " <IsFavourite>false</IsFavourite>"
$outName = " <Name>"+$FREQMAN.Name.ToString()+"</Name>"
$outGroup = " <GroupName>"+$FREQMAN.GroupName+"</GroupName>"
$outFreq = " <Frequency>"+$FREQMAN.Frequency+"</Frequency>"
$outDetect = " <DetectorType>"+$FREQMAN.DetectorType+"</DetectorType>"
$outShift = " <Shift>"+$FREQMAN.Shift+"</Shift>"
$outBand = " <FilterBandwidth>"+$FREQMAN.FilterBandwidth.toString()+"</FilterBandwidth>"
$outMemend = "</MemoryEntry>"

Write-Output $outMem | Add-Content $outFile
#Write-Output $outScan | Add-Content $outFile
Write-Output $outFav | Add-Content $outFile
Write-Output $outName | Add-Content $outFile
Write-Output $outGroup | Add-Content $outFile
Write-Output $outFreq | Add-Content $outFile
Write-Output $outDetect | Add-Content $outFile
Write-Output $outShift | Add-Content $outFile
Write-Output $outBand | Add-Content $outFile
Write-Output $outMemend | Add-Content $outFile

}
Write-Output "</ArrayOfMemoryEntry>" | Add-Content $outFile

*******************convert.ps1 is above this line***********************************************************************************
 
Status
Not open for further replies.
Top