% This file is embedded in datatool-user.pdf version 3.4.3 2025-12-04
% Example 64 Trimming New Values
% Label: "ex:newvaluetrim"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage{datatool}
\DTLnewdb{mydata}
\DTLnewrow{mydata}
\DTLsetup{new-value-trim=true}
\DTLnewdbentry{mydata}{Column1}{ value1 }
\DTLnewrow{mydata}
\DTLsetup{new-value-trim=false}
\DTLnewdbentry{mydata}{Column1}{ value2 }
% compare with \DTLaction:
\DTLsetup{default-name=mydata}
\DTLaction{new row}
\DTLaction[column=1,value= value3 ]{new entry}
\DTLaction{new row}
\DTLaction[column=1,value={ value4 }]{new entry}
\begin{document}
% display the data with the values quoted:
\renewcommand{\dtlstringformat}[1]{``#1''}
\DTLdisplaydb{mydata} 
\end{document}
