Create a map of IgorPro functions in procedure files
Aim make a map of all the functions in Igor procedure files to enable the location of appropriate code for other projects.
This is a solution for macOS. It uses shell commands, Igor and lastly d3.js to display the map. It uses work by other people that I have appropiated.
- In the terminal, cd to the directory containing the
*.ipffiles you want to map. Execute:
grep "^[ \t]*Function" *.ipf | grep -oE '[ \t]+[A-Za-z_0-9]+\(' | tr -d " " | tr -d "(" > output for i in `cat output`; do grep -ie "$i" *.ipf | grep -w "Function" >> funcfile.txt ; done sed -i -e 's/.ipf:Function / /g' funcfile.txt
JSONFromFuncFile.ipf, point Igor to
- The resulting file,
funcMap.jsoncan be used with
display.htmlto see the map.
- The tab character is used in
sed. Use ctrl+v and tab to get it if copy paste or .sh does not work.
- The d3.js example is from here and working example.
- Only Functions are mapped, Static Functions and other stuff are not, but feel free to modify.
- Converting tsv to json using this Igor code works but is a bit quick and dirty: might not work in all cases.