We studied the trajectories of polymers being advected while diffusing in a pressure driven flow along a periodic pillar nanostructure known as nanoscale deterministic lateral displacement (nanoDLD) array. We found that polymers follow different trajectories depending on their length, flow velocity and pillar array geometry, demonstrating that nanoDLD devices can be used as a continuous polymer fractionation tool. As a model system, we used double-stranded DNA (dsDNA) with various contour lengths and demonstrated that dsDNA in the range of 100-10000 base pairs (bp) can be separated with a size-selective resolution of 200 bp. In contrast to spherical colloids, a polymer elongates by shear flow and the angle of polymer trajectories with respect to the mean flow direction decreases as the mean flow velocity increases. We developed a phenomenological model that explains the qualitative dependence of the polymer trajectories on the gap size and on the flow velocity. Using this model, we found the optimal separation conditions for dsDNA of different sizes and demonstrated the separation and extraction of dsDNA fragments with over 75% recovery and 3-fold concentration. Importantly, this velocity dependence provides a means of fine-tuning the separation efficiency and resolution, independent of the nanoDLD pillar geometry.