In my previous post I described how to convert NIST LC-MS/MS libraries to .msp format using the lib2nist program. This procedure will not work for the mainlib and replib EI libraries. For some reason these are encoded differently and will not appear in lib2nist as source libraries for conversion. The only way I have found to convert these is to use the Agilent version of the NIST library, which comes with the library in two different formats: the NIST format, which you can’t convert, and a .L format file used by Agilent’s MassHunter software suite. This latter file appears to contain all of the spectra from mainlib and replib, as well as some Kovats Retention Index data (of which more later).
To convert this .L format library using lib2nist you just have to select the file as the conversion source.
Once you have selected the source file to export from you need to select a subset fo the data to export as lib2nist will not export the whole thing in one go. I can’t remember how many files you should select but I think it has to be blocks of about 50K. There are nearly 400K spectra in NIST2020 so that’s eight subfiles you need to export and then combine.

Once you have exported the separate files you will need to use a large text file editor, such as Vim, to combine them into one file. Then you should be able to select that file in MS-DIAL to get identities for all of your features.
Thanks to Raquel Cumeras (Twitter @rcumeras) for reminding me how to do this.
Addition:
I have confirmed that lib2nist cannot export more than 64K spectra at a time when working on EI libraries. I tried exporting 250K, which works when you export the LC-MS/MS libraries. Here’s the error it threw:

Hi,
Thanks for this helpful post! I am wondering if you could explain to me, how you combined the single msp files in one big?
Thanks!
LikeLike
Copy and paste in Vim.
LikeLike
Hi CHRIS, would it be possible to share your nist datebase in msp format? thank you very much.
LikeLike
No, it’s not free to distribute.
LikeLike
Hi Chris, I just wanted to evidence that Lib2NIST does not work on mainlib and replib in NIST format (that’s my case as I didn’t buy the Agilent format), while it can address the LC databases – don’t ask me why…
The workaround was to extract the databases content through the “Other Search” tab, selecting compounds by ID Number (in chunks of 5000 at a time – that’s 62 for mainlib..) selecting and exporting to .MSP files, then collating in a big MSDIAL-compatible MSP library. That’s tedious but worth it – it’s a one time work
LikeLiked by 1 person