Skip to content
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

importation of values from text file #205

Open
lpatiny opened this issue Mar 15, 2019 · 0 comments
Open

importation of values from text file #205

lpatiny opened this issue Mar 15, 2019 · 0 comments

Comments

@lpatiny
Copy link
Member

lpatiny commented Mar 15, 2019

I have an text file that contains many results for the same product of elementAnalysis.

I would like therefore to add many entries in the table spectra -> elementAnalysis

This can be done usually using 'addAttachments' that allows to attach many files at once.

My problem is that I have no attachment. Each entry contains only the metadata and therefore the test of the attachment fails (no field, buffer, etc.). Would it possible to add a flag 'onlyMeta' or something like that ?

  for (let line of lines) {
    let metadata = {
      c: line[10],
      h: line[9],
      n: line[11],
      instrument: {
        model: '',
        manufacturer: ''
      }
    };

    const hash = md5(line).substring(0, 8);
    result.addAttachment({
      jpath: ['spectra', 'elementalAnalysis'],
      metadata,
      reference: hash // we ensure the unicity of the reference as well
    });
  }
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

No branches or pull requests

1 participant