subject

Create an application that reads a file that contains an email list, reformats the data, and writes the cleaned list to another file. Below are the grading criteria…
Fix formatting. The application should fix the formatting problems.
Write the File. Your application should write a file named prospects_clean. csv.
Use title case. All names should use title case (an initial capital letter with the rest lowercase).
Fix email addresses. All email addresses should be lowercase.
Trim spaces. All extra spaces at the start or end of a string should be removed.
Here is the code work I was working on. It seems that there are errors happening and I get message that file is not found when using this code…
import java. io. IOException;
import java. io. BufferedReader;
import java. io. FileReader;
import java. util. ArrayList;
public class CSVReader {
// Used to read CSV file
public static ArrayList readCSV(String fileName) throws IOException {
String line = " ";
BufferedReader br = null;
ArrayList ar = new ArrayList();
br = new BufferedReader(new FileReader(fileName));
// Reading content from CSV file
while ((line = br. readLine()) != null) {
ar. add(line);
}
// Closing Buffered Reader
br. close();
return ar;
}
}
import java. util. ArrayList;
public class Cleaner {
// Convert to title case
static String convert(String str) {
str = str. toLowerCase();
char[] array = str. toCharArray();
// Modify first element in array.
array[0] = Character. toUpperCase(array[0]);
// Return string.
return new String(array);
}
// CSV cleaner
public ArrayList CSVCleaner(ArrayList fileContent) {
ArrayList cleanerCon = new ArrayList();
String delimiter = ",";
StringBuilder newLine = null;
for (String str : fileContent) {
String[] fullLine = str. split(delimiter);
newLine = new StringBuilder();
for (int i = 0; i < fullLine. length - 1; i++) {
newLine. append(convert(fullLine[i]) + ",");
}
if (EmailValidator. isValidEmail(fullLine[fullLine. length - 1].toLowerCase())) {
newLine. append(fullLine[fullLine. length-1].toLowerCase());
} else {
newLine. append(convert(fullLine[fullLine. length - 1]));
}
cleanerCon. add(newLine. toString());
}
return cleanerCon;
}
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
Researchers measured the data speeds for a particular smartphone carrier at 50 airports. the highest speed measured was 78.1 mbps. the complete list of 50 data speeds has a mean of x overbarequals16.11 mbps and a standard deviation of sequals18.65 mbps. a. what is the difference between carrier's highest data speed and the mean of all 50 data speeds? b. how many standard deviations is that [the difference found in part (a)]? c. convert the carrier's highest data speed to a z score. d. if we consider data speeds that convert to z scores between minus2 and 2 to be neither significantly low nor significantly high, is the carrier's highest data speed significant? a. the difference is nothing mbps.
Answers: 3
question
Computers and Technology, 23.06.2019 09:00
Which company provides a crowdsourcing platform for corporate research and development? a: mtruk b: wiki answers c: mediawiki d: innocentive
Answers: 2
question
Computers and Technology, 23.06.2019 10:00
How do i delete my account on this because i didn't read this agreements and also i put age at xd
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Barbara is interested in pursuing a career in the science and math pathway. which qualifications will her reach that goal? a.an advanced knowledge of physics and math b.an advanced knowledge of engineering and math c. an advanced knowledge of physics and robotics an d. advanced knowledge of machinery and math
Answers: 2
You know the right answer?
Create an application that reads a file that contains an email list, reformats the data, and writes...
Questions
question
Mathematics, 21.07.2019 07:00
Questions on the website: 13722361