Question: Could you please show me how to code this in the most easy and simple way possible? CSVParser.Java //FIXME Add your own file header comment

Could you please show me how to code this in the most easy and simple way possible?

Could you please show me how to code this in the most

easy and simple way possible? CSVParser.Java //FIXME Add your own file header

CSVParser.Java

//FIXME Add your own file header comment here

/** * This class contains methods to parse text, specifically intended to eventually parse CSV (comma separated values) * files. * * Definitions of Terms: * delimiter: The character used to specify the boundary between fields in a sequence of characters. * for example, the comma would be the delimiter between the fields: * name, id, section * Note the field values include the spaces. In general, the field value is every character except * for the delimiter. * * qualifier: If a field value contains a delimiter such as a comma with the name field: * John Doe, MD, 1234567, 321 * then a qualifier, such as ", is placed around a field value to indicate it is the same field. * for example: * "John Doe, MD", 1234567, 321 * If the qualifier itself is a part of the field value then the qualifier is duplicated. * for example for the field value: * H. Jackson Brown, Jr. said "The best preparation for tomorrow is doing your best today." * would be enclosed with " and internal quotes duplicated resulting in the qualified field value: * "H. Jackson Brown, Jr. said ""The best preparation for tomorrow is doing your best today.""" * * A example with , as delimiter and " as qualifier with a newline in a field value should be * processed as follows: * "This is a line of text.",bbb,ccc * would have 3 fields * "This is a line of text." * bbb * ccc * * This project is derived from RFC 4180: https://tools.ietf.org/html/rfc4180 * */ public class CSVParser { /** * This method returns the array of string containing the field values. * The field values in text are identified using , as the delimiter. * Qualifiers are not considered at all in the parsing of text. * * Example: * aaa,bbb,ccc * should result in an array with 3 fields * aaa * bbb * ccc *

In this assignment, write code to analyze a string character-by-character and return the field values within it. This is called parsing. Do not use String split,Scanner or other code that has similar functionality in your implementation of this assignment. The intent of this assignment is that you learn the process of analyzing and decision making when looking through a string of characters using loops and branch statements. Create a new project, CSVParser is a reasonable choice. A skeleton file with all the methods for P7 is CSVParser java. Right-click on the file link to save the file. Move the file to the project source folder. Read through the comments. In part 1, implement the method with header: public static Stringll separate (String text) Then generalize to use any delimiter passed as a parameter in public static Stringl separate(String text, char delimiter) Note that once the 2nd method is implemented then the implementation of the first method could be changed to be: public static Stringll separate (String text) t return separate( text, ', A test bench for all the methods in P7 is TestCSVParserjava Right-click the link and save the file and then move to the same project source folder as CSVParserjava. Use the test bench by uncommenting the appropriate test method in main and then run TestCSVParser. The testing methods in TestCSVParser call the methods in CSVParser

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!