A method for machining a workpiece, an electrode being situated at a distance from a workpiece to be machined and moved linearly in the direction of the workpiece to be machined to cause material to be removed from the workpiece during the approach to the workpiece, at least one end or one section of one end of a surface of the workpiece to be machined running obliquely to a guide edge of the electrode machining this surface, the method comprising:
- moving the electrode at least partially with the electrode surface parallel to the surface to be machined, so that during an approach of the electrode to the workpiece, areas of the workpiece having an irregular edge machined at a different intensity are formed, the difference in intensity of machining on the edge of the surface to be machined being compensated in that the surface to be machined is provided with a height profile adapted to the shape of the end of the surface to be machined.