Fitting multiple graphs using procedures

If I have multiple waves by the name of 'abc_01' to 'abc_10' and 'xyz_01' to 'xyz_10', is it possible to write a procedure to graph and fit (linear fit) abc_01 vs xyz_01, abc_02 vs xyz_02, and so on in one go to avoid running the same procedure for different fits?

It seems trivial but I am using procedures in Igor for the first time so any help would be greatly appreciated.

Thank you
I am using the following basic code for one fitting. First I want to make a function which accepts two waves as an argument and does the exact same thing and secondly I want to include a loop so that it does the same thing for a number of waves (batch fitting).

    Display abc_01 vs xyz_01
    ModifyGraph tick(left)=2,mirror(left)=2,minor(left)=1,standoff(left)=0;DelayUpdate
    ModifyGraph tick=2,mirror=2,minor=1,standoff=0;DelayUpdate
    Label left "\\F'Arial'R\\Bxy\\M\\F'Arial' (\\F'Symbol'\\F'Arial'W)";DelayUpdate
    ModifyGraph highTrip(bottom)=100000
    Label bottom "Field (Oe)";DelayUpdate
    SetAxis bottom -20000,20000
    ModifyGraph mode=3,marker=8
   
    CurveFit/NTHR=0/TBOX=784 line  abc_01 /X=xyz_01 /D
      fit_abc_01= W_coef[0]+W_coef[1]*x
    TextBox/C/N=CF_abc_01/F=0
    ModifyGraph rgb(fit_abc_01)=(0,0,0)
    ModifyGraph mrkThick(abc_01)=1.5,lsize(fit_abc_01)=1.5

        Legend/C/N=text0/F=0/S=3/A=MC
Perhaps you are looking for the Batch Fit package. Analysis->Packages->Batch Curve Fit. The package was added relatively recently- if you don't find it you may need to update your Igor version: Help->Updates for Igor Pro x.xx.

Be sure to check out the demo: File->Example Experiments->Curve Fitting->Batch Curve Fit Demo.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com