add pattern and truncation to data