Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
prog-1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pedro Folloni Pesserl
prog-1
Commits
e2392d91
Commit
e2392d91
authored
2 years ago
by
Pedro Folloni Pesserl
Browse files
Options
Downloads
Patches
Plain Diff
tshell: p3: add sed command
parent
13ab1129
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-2
1 addition, 2 deletions
.gitignore
tshell/tshell_p3.sh
+21
-4
21 additions, 4 deletions
tshell/tshell_p3.sh
with
22 additions
and
6 deletions
.gitignore
+
1
−
2
View file @
e2392d91
./nomes-de-bebes/
./PubMed/
./Sinonimos/
./tshell/temp/
This diff is collapsed.
Click to expand it.
tshell/tshell_p3.sh
+
21
−
4
View file @
e2392d91
...
...
@@ -35,7 +35,24 @@ CSV=$2
confere_arq_saida
$CSV
CSV
=
$(
realpath
$CSV
)
# separar os campos necessários do arquivo xml.gz
# zcat $XML | xgrep -tx "//PMID|//ArticleTitle|//Abstract|//MeshHeadingList"
# separar os campos úteis do arquivo xml.gz
zcat
$XML
|
\
xgrep
-tx
"//PMID|//ArticleTitle|//Abstract|//MeshHeadingList"
|
\
# o sed acha um campo PMID, seguido de um campo ArticleTitle, seguido
# de um campo Abstract, e imprime. Se houver um campo MeshHeadingList
# após o Abstract, imprime também.
sed
-En
'
/<PMID/{
N;
/<ArticleTitle>/{
N;
/<Abstract>/{
p;
n;
/<MeshHeadingList>/{
p;
}
}
}
}'
>>
$CSV
# grep 'PMID' ARQUIVO_COM_CAMPOS_SEPARADOS | awk '{ print substr($0, 16, length($0)-22) }' | sed 's/">//'
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment