mimic-code icon indicating copy to clipboard operation
mimic-code copied to clipboard

sed error while generating concepts

Open yypark24 opened this issue 3 years ago • 4 comments

Prerequisites

  • [X ] Put an X between the brackets on this line if you have done all of the following:
    • Checked the online documentation: https://mimic.physionet.org/about/mimic/
    • Checked that your issue isn't already addressed: https://github.com/MIT-LCP/mimic-code/issues?utf8=%E2%9C%93&q=

Description

The postgres database is built and running fine. Then I tried the following two lines: psql -f postgres-functions.sql -d mimic bash postgres_make_concepts.sh

I get many of the following error messages repeatedly (the only table that doesn't produce this error and actually gets created at the end is the diagnosis table). sed: 1: "s/DATETIME_DIFF((.+?), ...": RE error: repetition-operator operand invalid sed: 1: "s/`physionet-data.(mimi ...": RE error: repetition-operator operand invalid

I could not find related issues either open or closed - thanks!

yypark24 avatar Mar 11 '21 20:03 yypark24

What version of sed do you use? I think I use GNU sed and if I recall BSD sed has different quirks..

alistairewj avatar Mar 17 '21 01:03 alistairewj

I didn't know but it seems that Mac uses BSD sed (i don't know the difference between the two)

yypark24 avatar Mar 17 '21 04:03 yypark24

I didn't know but it seems that Mac uses BSD sed (i don't know the difference between the two)

Try install GNU version of sed and set it as default. It's quite easy, just Google it.

JackieMium avatar Apr 30 '21 05:04 JackieMium

On macos run: brew info gnu-sed export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"

then which sed should return /usr/local/opt/gnu-sed/libexec/gnubin/sed

also, sed should return

Usage: sed [OPTION]... {script-only-if-no-other-script} [input-file]...
...
...
GNU sed home page: <https://www.gnu.org/software/sed/>.
General help using GNU software: <https://www.gnu.org/gethelp/>. 

After this, you can execute bash postgres_make_concepts.sh

jpetot avatar Jun 07 '22 13:06 jpetot