Script working: 1) tabs has been erased but some symbols had been erased too (And random number of character, why?) 2) all string duplicated. Why? If I commented "print FILE;" string, file has not change but just s/// must change file, isn't it?.

Your should not try to write to the same file as the one you read from. In most cases, this is at best messy.

Open one file (with one filehandler) for reading and another file (with another filehandler) for writing. After the process is completed and your files closed, just rename them to do the house cleaning.

Yes, I understand for 2 files. But why some symbols had been erased too? For other script the file changing without second file, only due to $`I = ".bak". But if I commented this string, the file don't changed.

As I said, if you try to write to the same file as the one you're reading from, you'll get unexpected results. I suspect that if you fix that, you will no longer be losing part of your input. That's why I told you to change that and see if you still have a problem. If you still do, you'll have to tell us more about your input data.

As for $^I = ".bak;", this variable is the $INPLACE_EDIT spedial variable, it enables you to modify a file that you are reading from (it really does exactly what I suggested you to do: open a file for reading, open another one for writing and doing the renaming of the files without you having to do it explicitely (the original file is renamed with the ".bak" extension).

If you open in read/write mode in order to change the file contents, you'll need to store the data in a var as you make the changes. When that's done you then need to use the seek function to reset the file pointer to the beginning of the file and then the truncate function to clear/delete the contents and then finally output the updated data to the file.