You can do this by using a server side scripting language like ASP, ASP.net or PHP.
In ASP for instance: let's say you call the asp-file with a querystring like this:
http://www.site name.com/yourpage.asp?par=2
Put this asp code in test.asp before the <DOCTYPE ..>-declaration or else if the declaration is absent before the <head> tag of your html:
<%
Dim par
par = 0
If request.Querystring("par") <> "" Then par = request.Querystring("par") End If
%>
And then, wherever you need it:
<!--#include file="somefile_<%= par %>.inc"-->
should do it, in this case the result will be:
<!-- #include file="somefile_2.inc" -->
If the asp file is called without a querystring like
http://www.site name.com/yourpage.asp
then the result will be:
<!-- #include file="somefile_0.inc" -->