DA0-002 Data Acquisition and Preparation Practice Question
A data analyst is importing a fixed-width text file into a relational database. The file has no header row, and fields are separated by a single space, but some fields contain trailing spaces of varying lengths that shift the apparent column boundaries. The analyst must load the data reliably into the correct columns. Which approach is most appropriate?
⚠ Common exam trap
The trap here is assuming any whitespace-separated text is delimited data, when varying trailing spaces mean the file is actually fixed-width and must be parsed by position.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Parse the file using fixed character positions derived from a documented layout specification rather than splitting on spaces.
Fixed-width files require position-based parsing because field boundaries are defined by character offsets, not delimiters. Documented offsets remain stable regardless of trailing spaces, whereas splitting on spaces or blindly converting delimiters misaligns columns. Loading the whole line or substituting commas defers or worsens the problem, so position-based parsing is the correct choice.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Split each line on the single space delimiter and assign fields sequentially to columns.
Why it's wrong here
Because some fields contain trailing spaces of varying lengths, splitting on a single space produces empty tokens or shifts subsequent values into the wrong columns. Delimiter-based parsing assumes consistent single separators, which this file does not provide. The result would be misaligned data and failed type conversions during load.
- ✓
Parse the file using fixed character positions derived from a documented layout specification rather than splitting on spaces.
Why this is correct
A fixed-width file defines each field by character position, so parsing by documented offsets preserves values even when trailing spaces vary. Splitting on spaces would misalign columns because multiple spaces are treated inconsistently. Using the layout specification is the reliable, repeatable way to load this format correctly.
- ✗
Import the entire line into a single column and rely on downstream views to extract fields.
Why it's wrong here
Loading each line as one undifferentiated column pushes the parsing problem downstream and prevents the database from enforcing column types or constraints. Downstream extraction would still face the same alignment issue and would be slower and harder to maintain. This defers rather than solves the data preparation requirement.
- ✗
Replace all spaces with commas and then load the file as comma-separated values.
Why it's wrong here
Replacing every space with a comma would also corrupt spaces that are part of legitimate field values and would not collapse the varying trailing spaces into consistent delimiters. The resulting file would have extra empty fields and misaligned columns. This transformation introduces new errors instead of resolving the fixed-width structure.
Go deeper
Related to this question
About these practice questions
One of 1,004 original DA0-002 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
This DA0-002 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DA0-002 exam.