[Eeglablist] How can I convert .xdf files to .bdf files while maintaining consistent event markers?

Arnaud Delorme adelorme at ucsd.edu
Tue Feb 17 12:33:53 PST 2026


The best approach is likely to import the multistream XDF into EEGLAB, convert the string event markers to numerical markers using a script, and then export to BDF.

Arno

> On Feb 17, 2026, at 10:13, Pieterjan Vande Casteele via eeglablist <eeglablist at sccn.ucsd.edu> wrote:
> 
> I am currently struggling with converting EEG data from XDF (LabStreamingLayer) to BDF format while maintaining consistent event markers.
> 
> The Problem: When I convert the files, my string-based markers (e.g., 'cross', 'stim', 'left_good', 'feedback') are being automatically assigned arbitrary integers. These integers change with every new recording (e.g., 'cross' might be 31670 in File A and 15521 in File B).
> 
> This makes batch processing impossible, as the analysis scripts expect fixed trigger values (like 101, 105, 20, etc.).
> 
> I need a reliable way to hardcode a specific mapping (e.g., {'cross': 101, 'left_good': 20}) so that any software (BioSig, EEGLAB, etc.) reads the exact same integer every time.
> 
> Does anyone have a script or workflow to force these string labels into fixed BDF trigger values without corrupting the file header or causing scaling/offset issues?
> 
> Thanks in advance for your help!
> 
> 
> _______________________________________________
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu or visit https://sccn.ucsd.edu/mailman/listinfo/eeglablist  .



More information about the eeglablist mailing list