Coder Social home page Coder Social logo

csv-converter-4's Introduction

CSV FILTERING This easy to implement project allows trade files from different banks to be rearranged into the proper format that it needs to be in.

The goal was to make everything very maintainable and modifiable.

The way that this project works is that every time a user uploads a csv file of their trades, it will convert to a standard format based on what is selected.

It follows the following steps:

  1. It initializes the function based on what type is selected
  2. It then converts all the data from the csv into an array
  3. Next it checks for errors in the errorCase function. There is an if statement for every type which can have a unique error checking statement in each. It can either return false or continue based on if the data is valid
  4. Then it runs a filtering function for every specific broker in order to manipulate the data and put it into the correct format
  5. It then maps everything into the proper format and downloads it the user
  6. For this repository please disregard any options or searching functions. This repository only takes care of mapping the data.

Adding a new broker

  1. Go into init.js and add the broker to the options variable.
  2. Go to the initAll function in submit.js and add a new type with the new broker name. Follow the same pattern.
  3. Inside of the errorCase function add an if statement with any custom function that checks if the format of the file is correct. Return false if it the format is not correct and return the corresponding filtering function if it is correct.
  4. Create a filtering function that filters and manipulates the data by looking at each row not including the header or any of the other rows.
  5. Add the mapToProperFormat function and specify how you want to map out this file based on indexes. Each index is of the original row and make it correspond to the final index in the proper format

I hope that this makes sense, I suggest taking a look at the repository with the searching functionality https://github.com/Pavel-2004/csv-converter-5 Please feel free to reach out to me with any questions, concerns, or criticism at [email protected].

LOGS Version 0 - 4/11/22 - Built layout of everything

  • built layout
  • only one original layout works which is the questrade original layout

Version 0.1 - 4/13/22 - Added RBC AND TD

  • Fixed naming of the files
  • Added a selector option into initializing
  • Added RBC and TD filtering system

Version 0.2 - 4/14/22 - Fixes

  • Fixed column names
  • Fixed security codes
  • prices made more accurate
  • TD account number fix
  • questrade unit# is now positive
  • last row in questrade fixed to appearing as CAD

Version 0.3 - 4/12/28 - further addition of banks and minor fixes

  • Currently there is extra search functions which for this repository should be disregarded as this takes care of only mapping the data
  • Added 4 other brokers
  • Fixed bug that didn't allow files with commas in the field to work properly because of delimiter issues.
  • Updated filtering functions that worked around commas to not have to work around them as those commas are now kept inside of the field.

csv-converter-4's People

Contributors

pavel-2004 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.