Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ionen-angewandte-physik
AG-Wester
bibtools
Commits
4c65e39c
Commit
4c65e39c
authored
Jan 14, 2021
by
User expired
Browse files
Restore accidentally removed line from previous commit
parent
e7fe72da
Pipeline
#40150
passed with stage
in 1 minute and 21 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
bin/bib-format
bin/bib-format
+8
-0
No files found.
bin/bib-format
View file @
4c65e39c
...
...
@@ -47,6 +47,13 @@ ba # Go to label a to repeat search.
'
"
$1
"
}
# Function to insert brackets around non quoted field contents.
function
insert_brackets
()
{
# insert_brackets bibfile
sed
-i
-r
'
s/^ ([A-Za-z][A-Za-z_-]*) = ([^{].*[^},])(,*)$/ \1 = {\2}\3/
'
"
$1
"
}
# Function to merge lines.
function
merge_lines
()
{
# merge_lines bibfilename
sed
-i
':a # Label with name a.
...
...
@@ -118,6 +125,7 @@ do
# Use curly brackets {} instead of double quotes "" or no quotes.
replace_quotes
"
$tmpfile
"
insert_brackets
"
$tmpfile
"
# Remove preceding and trailing whitespace in field contents.
sed
-i
's/ *\(},\?\)$/\1/'
"
$tmpfile
"
...
...
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