更改一组给定数据的格式，使其符合指定的标准格式。



给定数据：

Name|Address|Phone Number

John Smith|123 Main St|555-1234

Jane Doe|456 Oak Ln|555-5678

目标格式：

{“name”: “John Smith”, “address”: “123 Main St”, “phone”: “555-1234”},

{“name”: “Jane Doe”, “address”: “456 Oak Ln”, “phone”: “555-5678”}
用编程语言解决问题的伪代码实现可以如下所示：

```python
# Give input data as string
input_data = "Name|Address|Phone Number
John Smith|123 Main St|555-1234
Jane Doe|456 Oak Ln|555-5678"

# Split the input data into lines
lines = input_data.split("
")

# Get the headers of the data (Name, Address, Phone Number)
headers = lines[0].split("|")

# Loop through the remaining lines and create a dictionary with the headers as keys and the values as values
output_data = []
for line in lines[1:]:
    values = line.split("|")
    record = {}
    for i in range(len(headers)):
        record[headers[i].lower()] = values[i]
    output_data.append(record)

# Print the output data as JSON
import json
print(json.dumps(output_data))
```

输出会是：

```
[{"name": "John Smith", "address": "123 Main St", "phone number": "555-1234"}, {"name": "Jane Doe", "address": "456 Oak Ln", "phone number": "555-5678"}]
```