Code:

text temp_txt
{
strings = 1;
}

function del_last_char(_txt)
{
var handle;

//load the txt into a text object
txt_load(temp_txt,_txt);

//wait till its loaded
wait(3);

//cut off the last char
str_trunc(temp_txt.string[0],1);

//now resave the file:
handle = file_open_write(_txt);
file_str_write(handle,temp_txt.string[0]);
file_close(handle);
}

//call the function like this:
del_last_char("my_text_file.txt");



This is NOT tested but should work.