Jsoup Learning Note 10:saz2csv Parser

Source: Internet
Author: User

After a series of learning and groping, Jsoup study notes are about to end, the 11th study note will be the implementation of the functionality of the interface, and made a direct executable EXE file. Subsequent projects will continue to be updated if more in-depth learning jsoup are required.

This note is mainly to the previous 9 notes to integrate, the initial implementation of the SAZ format file to CSV file conversion basic functions, the basic functions of the program to achieve mainly:

1. saz file traversal: Gets the upper directory of the directory in which the Java project resides, specifying the file name extension (. saz),

2. Traverse the obtained upper-level directory, copy all folders that contain the specified file (. saz), and create a CSV file with the same name in the folder created with the same name.

3. Parse each saz file and write the parsed data to the CSV file created with the same name

4. Package Java project into a bat file that can be executed by double-clicking

The main points of knowledge involved in the learning process are:

1. Jsoup parsing strings, HTML documents

2. Java IO class: input/output stream, compressed stream (Zip stream)

3, Java File class operation: Files and folders traversal (recursive), read and write, copy, batch modification file suffix name, csv format file read and write

4. Use of the Java FilenameFilter class: Traversing a file with the specified suffix name

5. Processing of strings in Java: String class and StringBuffer class, substring (), indexOf (), lastIndexOf (), replace (), ReplaceAll (), Trim (), Use of methods such as toLowerCase (), EndsWith (), Equals (), Split ()

6. Java class set: List,arraylist,iterator

7, the use of the Java expression

8. How to package Java project into a double-click can execute jar file ,bat file

The above-mentioned knowledge points of specific use, the Internet has relevant examples, when we use these classes and methods , only need to understand its approximate usage or find the corresponding API can be, Do not need to memorize, when the targeted search can be met.

The folder directory structure before the program executes (there are no output folders in the source folder, 144p-1080p These 6 folders contain files in saz format, other folders are not) as shown in:



After the program executes the folder directory structure as shown in the newly created folder with the same name generated a CSV file with the same name, which holds the parsed data:




SOURCE program:

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Jsoup Learning Note 10:saz2csv Parser

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.