Java Language Need Read 2 Csv Files Contains Matrix File Need Add Print Output Q37157873

[JAVA LANGUAGE]i need to read 2 csv files which contains amatrix in each file. i need to add them and print the output


Answer


*Note: Since there is no size mentioned for the matrix,I am considering a 3×3 matrix is stored in both the CSV filesas:

470 258

file.csv

123 123 123 123

file2.csv

Code:

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class Test {

   public static void main(String[] args){
       String line = “”;
       int i=0;
       int Value1[][]=new int[3][3];
       int Value2[][]=new int[3][3];
       int Sum[][]=new int[3][3];
       try (BufferedReader br = newBufferedReader(newFileReader(“C:UsersCheggDesktopfile.csv”))) {
           while ((line

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.