ibw files import
ahmed.shaaban86
Dear all,
I have converted my recordings into ibw files to be able to pool them together. I have more than 100 ibw files produced. If I try to import them one by one, I run into the problem that they all had an initial name that is similar (although I have renamed them during saving). Is there a work around that I import them all with the renamed version?
Thank you very much in advance!
This happens because inside the IBW files the data has it's own wave name, which has nothing to do with the file name. The internal wave name might as well be always the same. A simple solution to load all files smoothly is to replace the wave name with the file name, which has to be different. Below script achieves this automatically after the file is loaded per drag and drop into the Igor window:
if(kind == 4)
SVAR name = S_waveNames
if (strlen(name) > 0)
Wave work = $StringFromList(0, name)
Duplicate/O work, $RemoveEnding(file, ".ibw")
Killwaves/Z work
KillPath/Z $pathName // get rid of symbolic path from hook
endif
endif
return 0
End
August 17, 2022 at 04:39 am - Permalink
In reply to This happens because inside… by chozo
Thank you very much for the feedback!
Do I run this as a function or as a macro?
I have dragged and dropped the file, then pasted this script in the cmd line but I got an error (kindly see the picture)
August 17, 2022 at 06:05 am - Permalink
Paste the function into the built in procedure window (type <Control>M to open OR open from windows>procedure windows menu) & recompile the procedure. Then drag & drop your file onto Igor.
August 17, 2022 at 06:10 am - Permalink
Dear chozo and jtigor,
You are amazing and saved my time!! Thank you very much and enjoy the rest of the day :)
August 17, 2022 at 06:25 am - Permalink