Skip to content

CSVFile --- class #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 31, 2018
Merged

Conversation

christianbender
Copy link

This class implements a data structure for handling of CSV-files.

Overview about methods

  • CSVFile(path : string, seperator : char)
    compiles the CSV-file in the inner data structure.

  • CSVFile (file : File, seperator : char)

  • CSVFile (seperator : char)

  • compile (row : string, seperator : char) : string
    compiles row in its columns.

  • isPunctuation (ch : char) : boolean
    check whether ch is a punctuation character.

  • getElementString(row : int, column : int) : string
    returns the specified element.

  • getElementDouble(row : int, column : int) : double
    returns the specified element as double.

  • addRow(row : string) : void
    adds a row to the inner data structure.
    without writing into the CSV-file.

  • commit() : void
    writes the added data into CSV-file.

  • commit(path : String) : void

  • commit(file : File ) : void

  • findRow(key : string) : ArrayList
    returns the searched row otherwise null.

  • contains(key : string) : boolean
    returns true if a row contains 'key' otherwise false.

  • getColumn(column : int) : ArrayList
    returns the specified column as ArrayList.

  • getColumn(key : string) : ArrayList

  • removeRow(key : string) : void
    purpose removes the specified row at the inner data structure.

  • removeRow(column : int) : void

  • updateFile() : void
    overwrites the CSV-file with the current inner data structure.
    removed rows are remove in the CSV-file, too.

  • updateFile(file : File) : void

  • getNumberOfRows() : int
    returns the number of rows in CSV-File
    it counts only rows that in the table.

Christian Bender added 2 commits December 15, 2017 22:34
This class implements a data structure for handling of CSV-files.
I add a method for manipulation individual fields.
@christianbender christianbender merged commit d012667 into TheAlgorithms:master Mar 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant