Skip to content

Commit 35043a2

Browse files
authored
Merge pull request #49 from NIB-SI/develop
display metadata in two columns
2 parents 26d7bba + 077826a commit 35043a2

File tree

5 files changed

+93
-17
lines changed

5 files changed

+93
-17
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,4 @@ Temporary Items
6666
.apdisk
6767
Metadata.md
6868
xCheckMetadata.md
69+
README.RMD

Templates/makeAssay.bat

+19-6
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,9 @@ rem type README.MD
320320
rem dir .
321321
cls
322322
echo ======================================
323-
echo Assay METADATA
323+
echo Assay METADATA
324324
echo ======================================
325-
rem call:showDesc %descFile%
326-
type %descFile%
325+
call:showDesc %descFile%
327326
cd ..
328327
rem copy existing files from nonversioned tree (if any)
329328
rem robocopy X-%ID% %ID% /E
@@ -879,7 +878,21 @@ rem -------------------------------------------------------------------
879878
::
880879
:: Example: call:showDesc %descFile%
881880
::
882-
setlocal
883-
For /F "TOKENS=1,2" %%A In (%~1) echo %%A %%B
881+
SETLOCAL EnableDelayedExpansion
882+
For /F "TOKENS=1-2 delims= " %%A In (%~1) do (
883+
call:showTwoCol "%%A" "%%B"
884+
)
884885
endlocal
885-
goto :EOF
886+
goto :EOF
887+
rem -------------------------------------------------------------------
888+
:showTwoCol --- show one line
889+
:: --- %~1 first column
890+
:: --- %~2 second column
891+
::
892+
:: Example: call:showTwoCol "Item name" "Item value"
893+
::
894+
set "_sp= "
895+
set "iname=%~1%_sp%"
896+
set "iname=%iname:~0,30%"
897+
echo %iname% %~2
898+
goto:eof

Templates/makeInvestigation.bat

+19-5
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ copy ..\common.ini . /b > NUL
126126
rem Display metadata
127127
cls
128128
echo ======================================
129-
echo Investigation METADATA
129+
echo Investigation METADATA
130130
echo ======================================
131-
type %descFile%
131+
call:showDesc %descFile%
132132
cd ..
133133
rem copy existing files from nonversioned tree (if any)
134134
rem robocopy X-%ID% %ID% /E
@@ -355,7 +355,21 @@ rem -------------------------------------------------------------------
355355
::
356356
:: Example: call:showDesc %descFile%
357357
::
358-
setlocal
359-
For /F "TOKENS=1,2" %%A In (%~1) echo %%A %%B
358+
SETLOCAL EnableDelayedExpansion
359+
For /F "TOKENS=1-2 delims= " %%A In (%~1) do (
360+
call:showTwoCol "%%A" "%%B"
361+
)
360362
endlocal
361-
goto :EOF
363+
goto :EOF
364+
rem -------------------------------------------------------------------
365+
:showTwoCol --- show one line
366+
:: --- %~1 first column
367+
:: --- %~2 second column
368+
::
369+
:: Example: call:showTwoCol "Item name" "Item value"
370+
::
371+
set "_sp= "
372+
set "iname=%~1%_sp%"
373+
set "iname=%iname:~0,30%"
374+
echo %iname% %~2
375+
goto:eof

Templates/makeStudy.bat

+27-3
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ copy ..\common.ini . /b > NUL
100100
rem Display metadata
101101
cls
102102
echo ======================================
103-
echo Study METADATA
103+
echo Study METADATA
104104
echo ======================================
105-
type %descFile%
105+
call:showDesc %descFile%
106106
cd ..
107107
rem copy existing files from nonversioned tree (if any)
108108
rem robocopy X-%ID% %ID% /E
@@ -272,4 +272,28 @@ setlocal enableextensions disabledelayedexpansion
272272
rem echo Selected file is "%my_file%"
273273
(endlocal
274274
set "%~2=%my_file%")
275-
goto :eof
275+
goto :eof
276+
rem -------------------------------------------------------------------
277+
:showDesc --- show description file in columns
278+
:: --- %~1 file name
279+
::
280+
:: Example: call:showDesc %descFile%
281+
::
282+
SETLOCAL EnableDelayedExpansion
283+
For /F "TOKENS=1-2 delims= " %%A In (%~1) do (
284+
call:showTwoCol "%%A" "%%B"
285+
)
286+
endlocal
287+
goto :EOF
288+
rem -------------------------------------------------------------------
289+
:showTwoCol --- show one line
290+
:: --- %~1 first column
291+
:: --- %~2 second column
292+
::
293+
:: Example: call:showTwoCol "Item name" "Item value"
294+
::
295+
set "_sp= "
296+
set "iname=%~1%_sp%"
297+
set "iname=%iname:~0,30%"
298+
echo %iname% %~2
299+
goto:eof

makeProject.bat

+27-3
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ copy ..\common.ini . /b > NUL
9595
rem Display metadata
9696
cls
9797
echo ======================================
98-
echo project METADATA
98+
echo project METADATA
9999
echo ======================================
100-
type %descFile%
100+
call:showDesc %descFile%
101101
cd..
102102
rem copy existing files from nonversioned tree (if any)
103103
rem robocopy X-%ID% %ID% /E
@@ -282,4 +282,28 @@ setlocal enableextensions disabledelayedexpansion
282282
rem echo Selected file is "%my_file%"
283283
(endlocal
284284
set "%~2=%my_file%")
285-
goto :eof
285+
goto :eof
286+
rem -------------------------------------------------------------------
287+
:showDesc --- show description file in columns
288+
:: --- %~1 file name
289+
::
290+
:: Example: call:showDesc %descFile%
291+
::
292+
SETLOCAL EnableDelayedExpansion
293+
For /F "TOKENS=1-2 delims= " %%A In (%~1) do (
294+
call:showTwoCol "%%A" "%%B"
295+
)
296+
endlocal
297+
goto :EOF
298+
rem -------------------------------------------------------------------
299+
:showTwoCol --- show one line
300+
:: --- %~1 first column
301+
:: --- %~2 second column
302+
::
303+
:: Example: call:showTwoCol "Item name" "Item value"
304+
::
305+
set "_sp= "
306+
set "iname=%~1%_sp%"
307+
set "iname=%iname:~0,30%"
308+
echo %iname% %~2
309+
goto:eof

0 commit comments

Comments
 (0)