-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Formatting Sample Data | ||
|
||
Working with sample/test data is a very common task when building applications. | ||
|
||
In the Petclinic application, the `src/main/resources/data/ownsers.csv` contains the list of owners formatted in a csv file. | ||
|
||
When looking it you can see that you have a column that could be removed (`default`), and ideally it would be nice to add a email for example with the format `first.last@petclinic.com`. | ||
|
||
How can you complete the following tasks: | ||
|
||
- Reformat the csv file, where you remove the default column and add email | ||
- Create a JSON file, that will be another file for our test environment | ||
|
||
|
||
<details> | ||
<summary>Possible Flow</summary> | ||
|
||
1. Open the `src/main/resources/data/ownsers.csv` file | ||
2. Select the content | ||
3. Use the Copilot Inline Chat (`Right click > Copilot`), and ask the following: | ||
|
||
`In the editor, remove the first column, and add a new one called email based on first.last@petclinic.com` | ||
4. Save the file. | ||
|
||
|
||
You can now for example copy the file and use the same approach to reformat to JSON or use the Chat using #file command. | ||
|
||
- `using #file:ownsers.csv , propose the same data as JSON array (do not provide the code to do it but the formatted data that I can add in a new file)` | ||
|
||
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"id","first_name","last_name","address","city","phone_number" | ||
"default","George","Franklin","110 W. Liberty St.","Madison","6085551023" | ||
"default","Betty","Davis","638 Cardinal Ave.","Sun Prairie","6085551749" | ||
"default","Eduardo","Rodriquez","2693 Commerce St.","McFarland","6085558763" | ||
"default","Harold","Davis","563 Friendly St.","Windsor","6085553198" | ||
"default","Peter","McTavish","2387 S. Fair Way","Madison","6085552765" | ||
"default","Jean","Coleman","105 N. Lake St.","Monona","6085552654" | ||
"default","Jeff","Black","1450 Oak Blvd.","Monona","6085555387" | ||
"default","Maria","Escobito","345 Maple St.","Madison","6085557683" | ||
"default","David","Schroeder","2749 Blackhawk Trail","Madison","6085559435" | ||
"default","Carlos","Estaban","2335 Independence La.","Waunakee","6085555487" |