Creating and editing a text file

Im trying to get the arduino to edit a txt file on an hdd through the computer.

That doesn't make sense IMHO. Make the Arduino output data through the serial port and write a program on the PC that reads that data and writes it into a file (possibly csv formatted, so you can easily graph it with Calc or Excel).