I seem to remember the the amplitude of a square wave is equal to the amplitude of its fundemental component (sine wave) + 1/3 the amplitude of the third harmonic + 1/5 of the fifth harmonic. Check with WIKIPEDIA for FOURIER series. So just measuring the amplitude of the waveform* will give the same amplitude as the sine wave recovered from it. Failing that what you need to do is to pass it through a low pass filter, so that only the fundemental gets through. Remember to calibrate the filters loss at the fundemental frequency. One way of doing this for a mains like voltage is to use a 1M ohm series resistor and a 100K load resistor with a 1 Mf capacitor across it. This will reduce the mains vol;tage to a safe level. So calibrate it by connecting the network across a low voltage AC supply, 24 V? measure what goes in and out of it with a DVM, then connect the 1M to your mains and the 1K to neutral/earth and measuure the voltage across the 1K. Sit down and calculate the mains input voltage.
Frank
* BEWARE if you are measuring with a DVM, check how they sense the voltage and how they are calibrated, you need a peak reading device.