How to (re)format and prepare CSV data for chart import

Often, there is the need to import csv datasets to analyze chart data. This example focuses on how to re-format the csv file for correct processing.

  1. The csv import format needs to be ordered like
    DateTime, Open, High, Low, Close
  2. The current csv might look like this (Example)
    Date,Time,Open,High,Low,Close
  3. There is the need to re-format the csv file prior to import to get the right format
    The separation between Date and Time needs to be decoupled and put into one information.
    E.g. 20180304,0915 needs to become 201803040915, ….
    To reformat the data, just use Notepad++, search for the expression
    ^([^,]*,[^,]*),(.*)$
    and replace with
    \1\2
  4. Import the file with manual DateTime interpreter

    yyyyMMddhhmm

  5. Cross-check regular expression to prepare/change your raw data in online tools like this examplehttps://regexr.com/42tmf