csv - Validation of TSV file in Java -


I create a web application to upload a tsv file

  1. JDK -> 1.4 " -> 1
  2. Resin -> 3.0.9

TSV file should be" \ t "," \ n "," \ R is parsed with "

validation.

1. What is the file name with the naming convention?

2. Is this a TSV file?

How should I recognize a picture or office document similar to TSV?

It depends on your definition, a TSV file.

Do all have the same columns? Or is it possible to leave the last empty pillars?

If they all have the same columns, then you can first recognize it if it fails, then you know that the file is not valid.

Do they have a top row? If so, you can use the answer to the above question and to parse the file.

What is the permission to quote? If so, is it allowed to have tabs on carriage return or quotation marks? (Does not necessarily help in verification, but you will have to think about parsing)

Is your text strictly a lesson? You can test for non-printable characters and reject it on that basis. Then take caution on the character encoding (UTF vs ASCII, etc.) used for the file. It can be placed in a code that parses from flat files to the data structure (for example, the map list) first.

Drilling yourself into the file, if this format is the default or type some data is known that you can create a secondary parser to validate this data (date, timestamp or other fixed format string) . This second level can be done when you get more information about the material and processing the data from the above structure.

All the above are empirical analyzes, as if you should expect false positive methods, though false should not be negative if you choose the rules for which your entry files are necessary. Therefore, with the processing stack everyone is expected to face the invalid data and be ready to invalidate the complete file input, in other words it never assumes that the test is fully assured that the file is correct.

I hope this helps.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -