In the research of petroleum exploration and development, original wellbore files collected by researchers are characterized by the massive data volume, diverse file types, and inconsistent file naming methods, which leads to time-consuming data format rearrangement for researchers. This paper proposed an automatic recognition method of wellbore data based on the Levenshtein distance similarity and TF-IDF (Term Frequency Inverse Document Frequency), which can automatically identify and process data of the wellhead, well trajectory, well interval division, mud logging lithology, and well logs of various wellbore file types and convert them into a unified standard format for storage. Compared with manual data sorting, the proposed methods deliver a reduction of data processing time of about 60% and greatly improve the data processing efficiency, also laying a foundation for subsequent data management.