Giter VIP home page Giter VIP logo

archivist-utilities's Introduction

archivist-utilities

This is a tool that implements the functionality described at https://ucldata.atlassian.net/wiki/spaces/CLOS/pages/37323492/Using+Txt+Files

The tool is accessible at https://closer-cohorts.github.io/archivist-utilities/

It accepts as input an Excel file (.xlsx)

The worksheet containing data from which the qv, tv and tq mappings are created MUST be the first worksheet in the file. This worksheet can have any name.

The worksheet containing data from which the dv mappings are created MUST be the second worksheet in the file. This worksheet can have any name.

QV mappings file

The following column headers must be present in the first worksheet in the input Excel file, in order to create the qv text files:

  • Questionnaire prefix
  • Question name
  • Dataset prefix
  • Variable name

The headers are not case sensitive, i.e. a column called 'question name' instead of 'Question Name' is acceptable.

A separate qv text file will be created for each unique questionnaire prefix value in the first worksheet in the input Excel file.

For example, if some rows in the input worksheet had the value 'heaf_17_fup4' for the 'Questionnaire prefix' column, and some other rows had the value 'heaf_17_fup5' for that column, this would result in 2 text files being generated:

  • heaf_17_fup4_qv.txt (containing all the rows which had the value 'heaf_17_fup4' in the 'Questionnaire prefix' column)
  • heaf_17_fup5_qv.txt (containing all the rows which had the value 'heaf_17_fup5' in the 'Questionnaire prefix' column)

TV mappings file

The following column headers must be present in the first worksheet in the input Excel file, in order to create the tv text files:

  • Dataset prefix
  • Variable name
  • Topic id

The headers are not case sensitive, i.e. a column called 'dataset prefix' instead of 'Dataset Prefix' is acceptable.

A separate tv text file will be created for each unique dataset prefix value in the input Excel file.

For example, if some rows in the input worksheet had the value 'heaf_17_fup4' for the 'Dataset prefix' column, and some other rows had the value 'heaf_17_fup5' for that column, this would result in 2 text files being generated:

  • heaf_17_fup4_tv.txt (containing all the rows which had the value 'heaf_17_fup4' in the 'Dataset prefix' column)
  • heaf_17_fup5_tv.txt (containing all the rows which had the value 'heaf_17_fup5' in the 'Dataset prefix' column)

TQ mappings file

The following column headers must be present in the first worksheet in the input Excel file, in order to create the tq text files:

  • Questionnaire prefix
  • Question name
  • Topic id

The headers are not case sensitive, i.e. a column called 'question name' instead of 'Question Name' is acceptable.

A separate tq text file will be created for each unique questionnaire prefix value in the input Excel file.

For example, if some rows in the input worksheet had the value 'heaf_17_fup4' for the 'Questionnaire prefix' column, and some other rows had the value 'heaf_17_fup5' for that column, this would result in 2 text files being generated:

  • heaf_17_fup4_tq.txt (containing all the rows which had the value 'heaf_17_fup4' in the 'Questionnaire prefix' column)
  • heaf_17_fup5_tq.txt (containing all the rows which had the value 'heaf_17_fup5' in the 'Questionnaire prefix' column)

DV mappings file

The following column headers must be present in the first worksheet in the input Excel file, in order to create the dv text files:

  • Dataset prefix
  • Derived variable name
  • Source variable name

The headers are not case sensitive, i.e. a column called 'dataset prefix' instead of 'Dataset Prefix' is acceptable.

A separate dv text file will be created for each unique dataset prefix value in the input Excel file.

For example, if some rows in the input worksheet had the value 'heaf_17_fup4' for the 'Dataset prefix' column, and some other rows had the value 'heaf_17_fup5' for that column, this would result in 2 text files being generated:

  • heaf_17_fup4_dv.txt (containing all the rows which had the value 'heaf_17_fup4' in the 'Dataset prefix' column)
  • heaf_17_fup5_dv.txt (containing all the rows which had the value 'heaf_17_fup5' in the 'Dataset prefix' column)

Text mapping file generation

To generate the text mapping files for Archivist from an Excel XLSX file, simply:

  1. Select the Excel XLSX file from your local computer by pressing the 'Choose file' button
  2. A 'Convert file' button will appear after you have selected an XLSX file. Press this button.
  3. Links to the various text files generated from this XLSX file will now displayed on the screen, and clicking on these will download the text files to your local computer.

archivist-utilities's People

Contributors

ollylucl avatar

Watchers

 avatar Jon Johnson avatar  avatar

archivist-utilities's Issues

Names of exported files

The DV and TV now contain the dataset names in the filenames, as there could be more than one, for consistency, can we include the questionnaire prefix in the name (-ccs01) for the QV and TQ files?

How do I run the process?

The process is no longer working? I uploaded the file, but there is no button to start it, and it is not starting automatically? This was working previously.

Edits to TQ - removal of rows for grids ($)

Apologies I should have included this in the criteria sooner, but for the TQ, can we remove all but one of the rows which have $ suffix (which have the same topic ID), keeping one row and deleting the $x;x.

So for example:

whii_85_hs1_ccs01 qc_10_a-e$1;1 107
whii_85_hs1_ccs01 qc_10_a-e$1;2 107
whii_85_hs1_ccs01 qc_10_a-e$1;3 107
whii_85_hs1_ccs01 qc_10_a-e$1;4 107
whii_85_hs1_ccs01 qc_10_a-e$1;5 107
whii_85_hs1_ccs01 qc_10_f-i$1;1 107
whii_85_hs1_ccs01 qc_10_f-i$1;2 107
whii_85_hs1_ccs01 qc_10_f-i$1;3 107
whii_85_hs1_ccs01 qc_10_f-i$1;4 107

would be changed to

whii_85_hs1_ccs01 qc_10_a-e 107
whii_85_hs1_ccs01 qc_10_f-i 107

If the topic IDs are different, then we need to keep both. So for example:

whii_85_hs1_ccs01 qc_10_a-e$1;1 108
whii_85_hs1_ccs01 qc_10_a-e$1;2 107
whii_85_hs1_ccs01 qc_10_a-e$1;3 107
whii_85_hs1_ccs01 qc_10_a-e$1;4 107
whii_85_hs1_ccs01 qc_10_a-e$1;5 107
whii_85_hs1_ccs01 qc_10_f-i$1;1 107
whii_85_hs1_ccs01 qc_10_f-i$1;2 107
whii_85_hs1_ccs01 qc_10_f-i$1;3 107
whii_85_hs1_ccs01 qc_10_f-i$1;4 107

would be changed to

whii_85_hs1_ccs01 qc_10_a-e 108
whii_85_hs1_ccs01 qc_10_a-e 107
whii_85_hs1_ccs01 qc_10_f-i 107

Let me know if this doesn't make sense or you need more examples.

Display errors on ui

At present, errors are output to the developers console. Sensible, legible error messages should be displayed on the front end to the user.

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.