开发者

Excel or text file, which one to use?

开发者 https://www.devze.com 2023-01-26 17:08 出处:网络
I need to suggest an input, excel file or text file. assuming t开发者_如何学Pythonhe input is large number of lines where I need to read the first String, for example:

I need to suggest an input, excel file or text file. assuming t开发者_如何学Pythonhe input is large number of lines where I need to read the first String, for example:

A,B,C,D....

I need to read the first String (in this case A) to identify the matching row, should I use excel file and use POI to read the first cell of each row? or text file where each line tokens are separated by delimiter and to parse each line reading the first token.


Use a text file. Because computers like it more. If business requires it, rename that text file into a "csv" file and you've got an Excel file.


If humans are going to enter data then use Excel. If the file is used as a communication channel between two systems use as simple as possible file.


If at all possible, use text file - much easier to handle/troubleshoot, easier to generate, uses less memory, does not have restrictions on number of rows, etc. In general - more predictable.

If you go with text files and you have people manually preparing those text files, and you are dealing with non-ASCII text, you better make sure everybody will send you the files in correct encoding (usually UTF-8 would be the best). This is not an issue with Excel.

The only reason to use Excel workbook would be when you need some "business-people" to produce those input files, then that input effectively becomes a user interface to your system - Excel is usually considered more user friendly than Notepad. ;-)

If you do go with Excel, make sure that the people producing those Excel files will give you the correct version (I assume you would want the "old" XLS format, not the new XLSX format).


Rule of thumb: use a text file. It's more interchangeable and way easier to handle by any other software you may need to support in a few years.

If you need some humans to edit those data and you need some beautiful/color display the Excel can provide, consider creating a macro that would store data in csv.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号