# Reformatting the Data

**Now we are actually going to move stuff around!**

1. Now you can close the June 15, 2018. csv and the template file
2. In the csv you have created, the first thing you should do is copy and paste the "Subject\_id" column from the Qualtrics data section to line up below the "name\_of\_child" column from the template data section (this should be column D). Then, delete the letter in front of each of the subject id's so that only the numbers are left.
3. Now, we will go back and fill in the three columns to the left.
4. The first column (column A) which is filled with CDI\_Words\_GESTURES\_fillable\_XXXX.pdf in the template version will be left blank.
5. The second column labeled "From" and filled with "anonymous user" will be the same for your reformatted data. To do this, type in "anonymous user" in the first row of your reformatted data, then hover over the bottom right hand corner of that cell until you see a black cross. When you see the cross, click and drag down to the last row of your reformatted data to fill all of the rows with "anonymous user."  &#x20;

   <img src="https://3364608434-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LD2B3y86yJyNeihFLqD%2F-LJnq5-j-zwMOyW9UMgS%2F-LJnnyofTs-6wbfU4dnG%2FScreen%20Shot%202018-08-13%20at%2010.59.21%20AM.png?alt=media&#x26;token=63a04323-a797-4c99-847f-0664f08169f5" alt="" data-size="original">
6. In column C, labeled "Received Date," in the template data, copy and paste the RecordedDate column from the Qualtrics data section.
7. Next, for columns E, F, and G line up "gender," "birthdate," and date\_today" correspond to "Q36," "Q36\_2" and "EndDate" respectively. Copy and paste these columns in the correct places.
8. As you will see, the data in the two gender columns is entered slightly differently. To fix this, highlight the "Q36" column, go to the "Edit" menu, click "Replace..." and a window like the one pictured below should pop up.

   <img src="https://3364608434-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LD2B3y86yJyNeihFLqD%2F-LJnqA-lj4C9ErV_ZWF7%2F-LJnvL6wg2-vNaM8-SpC%2FScreen%20Shot%202018-08-13%20at%2011.11.10%20AM.png?alt=media&#x26;token=ba1226f1-35fc-441a-99c1-ec2be4e435f9" alt="" data-size="original">
9. In the "Find what:" box type "Female" and in the "Replace with:" box type "f" and then click "Replace All." Then do the same thing for male to replace "Male" with "m."
10. The data in the "EndDate" column also looks slightly different. To fix this, highlight the EndDate column and in the top toolbar, where it says "Number" select "Date" in the drop down menu. This should reformat the date with just MM/DD/YY to match the template. <img src="https://3364608434-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LD2B3y86yJyNeihFLqD%2F-LJnqA-lj4C9ErV_ZWF7%2F-LJnyQdc0YnTi_HbgNMw%2FScreen%20Shot%202018-08-13%20at%2011.44.16%20AM.png?alt=media&#x26;token=f4beaf1e-a038-4bf9-9c4c-80cab2ae5433" alt="" data-size="original"> &#x20;
11. Now, the remaining columns should be in the right order! YAY!!!!
12. Highlight the Qualtrics data starting with the column titled "Q5\_1" until the third to last column titled "Q32\_15" and copy and paste this data in the columns to the right of the "EndDate" column in your reformatted section. At this point, the rightmost column of the template data should line up with the rightmost column of your reformatted data. If not, something is wrong :(
13. Once you have confirmed that you have the same number of columns in the template data as in your reformatted data you can delete the original data that you copied over from the Qualtrics spreadsheet.
14. Now its time for more replacing!!!
15. Highlight columns "Q6\_1" through "Q6\_28" using the replace tool that you used before, replace "Understands" with "Yes" and replace " " (blank cells, to do this you can just leave the "Find what:" box completely blank) with "Off."
16. Then, highlight columns "Q9\_1" through "Q26\_8" and replace "Understands and Says" with "understands and says", "Understands" with "understands", and " " (blank) with "Off."
17. Now, you can delete the rows of template data (BUT NOT THE COLUMN HEADINGS) and the column headings from the Qualtrics data. Your spreadsheet should now look like the image below. SAVE THE SPREADSHEET!!

![](https://3364608434-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LD2B3y86yJyNeihFLqD%2F-LJnqA-lj4C9ErV_ZWF7%2F-LJo1dV3VKLWfKepo8EK%2FScreen%20Shot%202018-08-13%20at%2012.06.41%20PM.png?alt=media\&token=ab129be1-13f9-488e-a641-dc56012ca0d8)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook.bergelsonlab.com/archive/duke-archive/qualtrics-to-webcdi/reformatting-the-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
