Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
IPSL
SIRTA
CL31
CL raw to 1a
Commits
84acf717
Commit
84acf717
authored
Jan 31, 2022
by
Marc-Antoine Drouin
Browse files
correct bug in case of empty line in input lists
parent
73137fa7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
run_raw2l1.sh
run_raw2l1.sh
+14
-8
No files found.
run_raw2l1.sh
View file @
84acf717
...
...
@@ -236,12 +236,17 @@ tmp_check=$(mktemp -d -p "$REP_TRAVAIL")
consignerMsg
"Vérification des données brutes"
for
file_
in
"
${
input_files
[@]
}
"
;
do
# check if empty line in input list
if
[[
-z
$file_
]]
;
then
continue
fi
tmp_file_
=
$(
basename
"
$file_
"
)
cl31_cor
=
"
$tmp_check
/
${
tmp_file_
%.*
}
.cor"
case
$fich_type
in
"SIRTA"
)
awk
--posix
-v
cl31_cor
=
"
$cl31_cor
"
'\
"SIRTA"
)
awk
--posix
-v
cl31_cor
=
"
$cl31_cor
"
'\
BEGIN {l=1;p=0;e=0;printf "" > cl31_cor}
NR<3 {print $0 >> cl31_cor;next}
l==1 {if ($0 ~ /^-[0-9-]{10} [0-9:]{8}.$/) {l++;bloc=$0;e=0;next} else if (e==1) {next} else e=1}
...
...
@@ -254,9 +259,9 @@ for file_ in "${input_files[@]}"; do
p==1 {printf bloc"\n" >> cl31_cor;l=1;p=0}
e==1 {err++;print NR;l=1}
END {if ($0 ~ "File") printf "\n%s\n",$0>>cl31_cor; if (err>0)print "err=",err}'
"
$file_
"
;;
"MF"
)
awk
--posix
-v
cl31_cor
=
"
$cl31_cor
"
'\
;;
"MF"
)
awk
--posix
-v
cl31_cor
=
"
$cl31_cor
"
'\
BEGIN {l=1;p=0;e=0;printf "" > cl31_cor}
l==1 {if ($0 ~ /^[\001]$/) {l++;bloc=$0;e=0;next} else if (e==1) {next} else e=1}
l==2 {if ($0 ~ /^-[0-9-]{10} [0-9:]{8}$/) {l++;bloc=bloc"\n"$0;next} else e=1}
...
...
@@ -269,9 +274,9 @@ for file_ in "${input_files[@]}"; do
p==1 {printf bloc"\n" >> cl31_cor;l=1;p=0}
e==1 {err++;print NR;l=1}
END {if ($0 ~ "File") printf "\n%s\n",$0>>cl31_cor; if (err>0)print "err=",err}'
"
$file_
"
;;
"P7"
)
awk
--posix
-v
cl31_cor
=
"
$cl31_cor
"
'\
;;
"P7"
)
awk
--posix
-v
cl31_cor
=
"
$cl31_cor
"
'\
BEGIN {l=1;p=0;e=0;printf "" > cl31_cor}
NR<3 {print $0 >> cl31_cor;next}
l==1 {if ($0 ~ /^-[0-9-]{10} [0-9:]{8}.$/) {l++;bloc=$0;e=0;next} else if (e==1) {next} else e=1}
...
...
@@ -284,6 +289,7 @@ for file_ in "${input_files[@]}"; do
p==1 {printf bloc"\n" >> cl31_cor;l=1;p=0}
e==1 {err++;print NR;l=1}
END {if ($0 ~ "File") printf "\n%s\n",$0>>cl31_cor; if (err>0)print "err=",err}'
"
$file_
"
;;
esac
done
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment