You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A field delimiter is needed to split the parsed values. As default the field delimiter is the **semicolon** (**;**), this means that during the parsing when a **semicolon (;)** is matched a new JSON entry is created.
198
198
In case your CSV file has defined another field delimiter you have to call the function ```fieldDelimiter(myDelimiter)``` and pass it as parameter the field delimiter.
199
199
@@ -204,11 +204,11 @@ E.g. if your field delimiter is the comma **,** then:
204
204
.getJsonFromCsv(fileInputName);
205
205
```
206
206
207
-
####Trim header field
207
+
### Trim header field
208
208
209
209
The content of the field header is cut off at the beginning and end of the string. E.g. " Last Name " -> "Last Name".
210
210
211
-
####Trim header field with whitespaces
211
+
### Trim header field with whitespaces
212
212
213
213
Use the method *trimHeaderFieldWhiteSpace(true)* to remove the whitespaces in an header field (E.g. " Last Name " -> "LastName"):
214
214
@@ -217,7 +217,7 @@ Use the method *trimHeaderFieldWhiteSpace(true)* to remove the whitespaces in an
217
217
.getJsonFromCsv(fileInputName);
218
218
```
219
219
220
-
####Support Quoted Fields
220
+
### Support Quoted Fields
221
221
To be able to parse correctly fields wrapped in quote, like the **last_name** in the first row in the following example:
222
222
223
223
|first_name| last_name |email|
@@ -242,18 +242,18 @@ The result will be:
242
242
]
243
243
```
244
244
245
-
####Index header
245
+
### Index header
246
246
If the header is not on the first line you can define the header index like:
247
247
248
248
```js
249
249
csvToJson.indexHeader(3)
250
250
.getJsonFromCsv(fileInputName);
251
251
```
252
252
253
-
####Empty rows
253
+
### Empty rows
254
254
Empty rows are ignored and not parsed.
255
255
256
-
####Format property value by type
256
+
### Format property value by type
257
257
The `formatValueByType()` function intelligently converts string values to their appropriate types while preserving data integrity. To enable automatic type conversion:
258
258
259
259
```js
@@ -263,7 +263,7 @@ csvToJson.formatValueByType()
263
263
264
264
This conversion follows these rules:
265
265
266
-
#####Numbers
266
+
#### Numbers
267
267
- Regular integers and decimals are converted to Number type
268
268
- Numbers with leading zeros are preserved as strings (e.g., "0012" stays "0012")
269
269
- Large integers outside JavaScript's safe range are preserved as strings
@@ -279,7 +279,7 @@ For example:
279
279
}
280
280
```
281
281
282
-
#####Boolean
282
+
#### Boolean
283
283
Case-insensitive "true" or "false" strings are converted to boolean values:
284
284
```json
285
285
{
@@ -288,7 +288,7 @@ Case-insensitive "true" or "false" strings are converted to boolean values:
0 commit comments