A data file named COVID-19GlobalData.txt has been provided in the zip file. The data file contains infection data relating to the COVID-19 pandemic. The data file was exported from the World Health Organisation web site (https://covid19.who.int/table) on 27th August 2021. The content of the file has been slightly modified for the purpose of this exercise. Each line of the text file contains 4 data values in the following order:
Name
Cases - cumulative total
Cases - newly reported in last 7 days
Cases - newly reported in last 24 hours
Each data value in the file is separated by a single space.
Write a java program that reads the data from the text file and displays it in a readable format similar to Figure 1. Your solution should not use an array or arraylist (there is no need to store all the file data in memory), must use a try-catch statement to check if the file exists before processing, and must use a try-catch statement to check for input mismatch exceptions while processing the file.
Notes:
(1) This is not an OOP exercise. You do not need to create a class - all code can be written in the main program file. (We will probably write an OO version of this code with extra functionality in the weeks ahead.)
(2) Explore how to generate column output like that shown in Figure 1 and use commas as the thousand's delimiter in the output.
(3) There are several example files in the week 6 lecture which will assist with several aspects of this question.
Figure 1: see image.
COVID-19GlobalData.txt
Global 213752662 4519052 655952
USA 37969371 1042666 153132
India 32558530 236272 46164
Brazil 20614866 198683 30872
RussianFederation 6824540 140009 19630
UK 6590751 234860 35547
France 6493798 132127 23427
Turkey 6273681 135229 19970
Argentina 5148085 51642 8119
Colombia 4894702 20533 2467
Spain 4815205 59730 5401
Iran 4796377 239960 39983
Italy 4502396 45631 7539
Indonesia 4026837 96537 0
Germany 3901799 58024 12626
Mexico 3249878 126626 18262
Poland 2887485 1406 215
SouthAfrica 2722202 83221 13251
Ukraine 2278171 7945 1581
Peru 2143691 7864 1126
Netherlands 1926424 17363 2863
Philippines 1883088 106980 13573
Iraq 1847697 46333 7787
Czechia 1678331 1302 248
Chile 1635173 4342 399
Malaysia 1616244 149732 22642
Bangladesh 1482628 35418 4698
Canada 1476149 18451 2525
Japan 1362813 160801 23698
Belgium 1173108 10386 3
Pakistan 1135858 26584 4199
Thailand 1120869 131010 18501
Sweden 1120628 6341 1278
Romania 1093924 4735 953
Portugal 1025869 16298 3062
Israel 1024100 58309 8800
Kazakhstan 829924 39719 0
Morocco 829137 47040 8008
Hungary 811517 736 180
Jordan 792278 5693 812
Switzerland 761831 13825 10
Nepal 752863 10635 0
Serbia 748693 12380 2327
UAE 712411 7322 983
Austria 675741 8678 1618
Tunisia 647483 15155 0
Cuba 611163 65888 8637
Lebanon 595522 8937 1593
Greece 570077 22891 3265
SaudiArabia 543028 2784 321
Georgia 532171 30874 4128
Ecuador 499196 2554 0
Bolivia 487721 3990 590
Belarus 472852 8997 1357
Paraguay 457971 948 133
Panama 453466 4542 480
CostaRica 447672 13591 2230
Bulgaria 446698 9371 1601
Guatemala 444924 22654 0
Kuwait 408797 1421 197
SriLanka 407768 34603 0
Azerbaijan 401828 24524 3794
Slovakia 394446 647 161
Uruguay 384287 782 106