MIT-LCP / mimic-code

MIMIC Code Repository: Code shared by the research community for the MIMIC family of databases
https://mimic.mit.edu
MIT License
2.59k stars 1.52k forks source link

sed error while generating concepts #868

Open yypark24 opened 3 years ago

yypark24 commented 3 years ago

Prerequisites

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!

alistairewj commented 3 years ago

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

yypark24 commented 3 years ago

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

JackieMium commented 3 years ago

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.

jpetot commented 2 years ago

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