SED query

I'm writing a script which word counts the number of lines in two files. If one file is bigger than the other I'd like to edit one of the files to delete some lines to make both the same. It does not matter where in the file the lines are deleted from. It's expected that this will be ran from crontab in root. I'm trying to use sed to do this but am having problems with passing the variable number of lines to delete. Can anyone help?

posting what exactly you're having problems with - could help us helping you!

To use a shell variable in a sed command, use double quotes rather than single quotes:

sed "1,$NUM d" FILENAME

That's worked thanks very much!