What does the CSV Column Splitter do?
The CSV Column Splitter divides a single selected CSV column into multiple separate columns based on a delimiter character or string (such as spaces, hyphens, slashes, semicolons, pipe characters, or custom strings). It supports in-place replacement or appending split columns, as well as customizable split limits while preserving RFC 4180 quotation formatting and custom delimiters.
Core Concepts
- Delimiter Segmentation: Expands a single text column into $N$ distinct output columns by parsing internal separators (e.g. splitting
"Alice Smith"on space produces"Alice"and"Smith"). - Auto Header Extension: Automatically derives intuitive names for newly created columns (e.g.
full_name_1,full_name_2). - In-Place or Append Mode: Replaces the source column directly at its current index, or preserves it while appending the newly generated columns.
How to use the tool?
- Input CSV Data: Paste your CSV spreadsheet data into the input box or click Load Sample.
- Configure Split:
- Column to Split: Select the target column you want to break apart.
- Split By: Choose Space, Hyphen, Slash, Semicolon, Pipe, or specify a Custom delimiter.
- Max Splits: Set maximum number of split parts (0 for unlimited).
- Keep Original Column: Check if you wish to retain the original column.
- Split & Export: Click Split Column, then click Copy or Download.
Related Developer Utilities
- CSV Column Merger: Combine two selected columns into one column using a separator.
- CSV Column Extractor: Extract specified columns and discard all others.
- CSV Column Renamer: Rename a single column header in place.
REST API Integration
blueutils.com provides a free REST API endpoint (POST https://blueutils.com/api/csv/csv-column-splitter) for programmatic integration.
API Request Parameters
| Name | Type | Description | Example |
|---|---|---|---|
rawText |
String | Raw CSV text payload. | "id,full_name\n1,John Doe" |
options |
Object | Optional split configurations. | { "columnIndex": 1, "splitSeparator": " " } |
options.columnIndex |
Number | Zero-based index of column to split. | 1 |
options.splitSeparator |
String | Delimiter string used to split cells. | " " |
options.customHeaderNames |
String / Array | Custom names for split columns (comma-separated or array). | "first_name, last_name" |
options.splitLimit |
Number | Maximum number of split pieces (0 = all). | 0 |
options.keepOriginal |
Boolean | If true, retains original column and appends. |
false |
options.hasHeader |
Boolean | Whether first line is a header row. | true |
API Request Payload Examples
cURL
curl -X POST https://blueutils.com/api/csv/csv-column-splitter \
-H "Content-Type: application/json" \
-d '{
"rawText": "id,full_name,department\n101,Alice Smith,Engineering\n102,Bob Jones,Marketing",
"options": {
"columnIndex": 1,
"splitSeparator": " ",
"customHeaderNames": "first_name, last_name",
"keepOriginal": false
}
}'Python
import requests
url = "https://blueutils.com/api/csv/csv-column-splitter"
payload = {
"rawText": "id,full_name,department\n101,Alice Smith,Engineering\n102,Bob Jones,Marketing",
"options": {
"columnIndex": 1,
"splitSeparator": " "
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String jsonPayload = "{\"rawText\": \"name\\nJohn Doe\", \"options\": {\"columnIndex\": 0, \"splitSeparator\": \" \"}}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://blueutils.com/api/csv/csv-column-splitter"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}API Response Parameters
| Name | Type | Description | Example |
|---|---|---|---|
isValid |
Boolean | Indicates whether the split operation succeeded. | true |
result |
String | Resulting CSV spreadsheet text. | "id,full_name_1,full_name_2,dept\n..." |
targetColumnName |
String | Name of the source column that was split. | "full_name" |
splitCount |
Number | Number of columns created from split. | 2 |
rowCount |
Number | Total data row count. | 2 |
finalColumnCount |
Number | Total column count in output data. | 4 |
API Response Payload Examples
Success Response (HTTP 200 OK)
{
"isValid": true,
"result": "id,full_name_1,full_name_2,department\n101,Alice,Smith,Engineering\n102,Bob,Jones,Marketing",
"headers": ["id", "full_name_1", "full_name_2", "department"],
"targetColumnIndex": 1,
"targetColumnName": "full_name",
"splitCount": 2,
"splitSeparator": " ",
"keepOriginal": false,
"rowCount": 2,
"originalColumnCount": 3,
"finalColumnCount": 4
}Error Response (HTTP 400 Bad Request)
{
"isValid": false,
"error": "CSV input cannot be empty."
}Rate Limit Exceeded Response (HTTP 429 Too Many Requests)
{
"error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}Why use an API to split CSV columns?
Integrating the CSV Column Splitter API into CI/CD pipelines, automated ETL pipelines, or autonomous agent workflows provides several practical advantages:
- Rapid Script Validation: Dissect combined database attributes (e.g.
YYYY-MM-DDtimestamps,first lastnames, orlat,longcoordinates) into clean atomic columns prior to SQL warehouse imports. - Optimized Token Efficiency for AI Agents: Executing string splits via a dedicated API call eliminates repetitive token generation across huge datasets.
- Deterministic Accuracy Without Hallucinations: Language models frequently lose alignment when parsing strings with variable numbers of tokens. Delegating processing to a deterministic API guarantees 100% computational accuracy every time without token overhead.
Native Usage
How to achieve the same task locally without external dependencies using native operating system utilities and scripting languages:
Windows (CMD / PowerShell)
Using native PowerShell calculated split expressions:
# Split full_name column into first_name and last_name
Import-Csv -Path "input.csv" | Select-Object id, @{Name='first_name';Expression={$_.full_name.Split(' ')[0]}}, @{Name='last_name';Expression={$_.full_name.Split(' ')[1]}}, department | Export-Csv -Path "output.csv" -NoTypeInformationLinux / Unix (Bash / Shell)
Using standard Linux awk:
# Split 2nd column on space and output as separate CSV columns
awk -F',' 'NR==1 {print $1",first_name,last_name,"$3; next} {split($2,a," "); print $1","a[1]","a[2]","$3}' input.csv > output.csvPython
Using the Python standard library csv module:
import csv
with open("input.csv", mode="r", encoding="utf-8") as infile:
reader = csv.reader(infile)
header = next(reader)
rows = list(reader)
# Split column 1 into 2 parts
new_header = [header[0], f"{header[1]}_1", f"{header[1]}_2"] + header[2:]
new_rows = []
for row in rows:
parts = row[1].split(" ", 1)
p1 = parts[0] if len(parts) > 0 else ""
p2 = parts[1] if len(parts) > 1 else ""
new_rows.append([row[0], p1, p2] + row[2:])
with open("output.csv", mode="w", newline="", encoding="utf-8") as outfile:
writer = csv.writer(outfile)
writer.writerow(new_header)
writer.writerows(new_rows)
print("Column split successfully.")Java
Using standard Java java.nio.file.Files:
import java.nio.file.*;
import java.util.*;
public class SplitCsvColumnExample {
public static void main(String[] args) throws Exception {
List<String> lines = Files.readAllLines(Paths.get("input.csv"));
if (lines.isEmpty()) return;
List<String> output = new ArrayList<>();
output.add("id,first_name,last_name,department");
for (int i = 1; i < lines.size(); i++) {
String[] cells = lines.get(i).split(",");
String[] names = cells[1].split(" ", 2);
String p1 = names.length > 0 ? names[0] : "";
String p2 = names.length > 1 ? names[1] : "";
output.add(cells[0] + "," + p1 + "," + p2 + "," + (cells.length > 2 ? cells[2] : ""));
}
Files.write(Paths.get("output.csv"), output);
System.out.println("Column split successfully.");
}
}