max1987

Deleting rows in a txt-document using Python

Discussion created by max1987 on Jun 17, 2013
Latest reply on Sep 15, 2013 by grubert74
Hi,

first of all, sorry for my poor english...

HERE'S MY PROBLEM:
I have a txt-file in which XY coordinates are stored.
I want to load these coordinates using the WARP-tool. So far, this is no problem but in the first row of the txt- document is some text. Unfortunatly the WARP-tool can only read the coordinates, when there is NO text in front of them.

WHAT I WANT:
of course I could delete the text manually, but I want to have it done automatically. I think this should be possible because the text is always in the first row(s) of the text-document.
The optimal solution for me would be an Python-Script that says: " 1) load all txt-files in the folder C:\... 2) for each file, delete the first 1 or 2 rows 3) save/overwrite the modified files "
In  the end I want to include the script into the Model Builder...

Thanks in advance!
Max

Outcomes