From 42507da581753270f110d67b9b9e07fc5ec417fb Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Thu, 10 Apr 2025 08:26:59 +0200 Subject: [PATCH 1/7] fix: create tool command for windows users --- scripts/create-tool.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/create-tool.mjs b/scripts/create-tool.mjs index 3032f95..2acbba4 100644 --- a/scripts/create-tool.mjs +++ b/scripts/create-tool.mjs @@ -54,7 +54,7 @@ function createFolderStructure(basePath, foldersToCreateIndexCount) { } // Start the recursive folder creation - recursiveCreate('.', 0); + recursiveCreate('/', 1); } const toolNameCamelCase = toolName.replace(/-./g, (x) => x[1].toUpperCase()); From c8150ad87362a44b2138b70ec135e44e717ccdb7 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Thu, 10 Apr 2025 15:26:25 +0200 Subject: [PATCH 2/7] fix : correct short description --- src/pages/tools/csv/csv-rows-to-columns/meta.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/tools/csv/csv-rows-to-columns/meta.ts b/src/pages/tools/csv/csv-rows-to-columns/meta.ts index e4d8c3d..49dd3bc 100644 --- a/src/pages/tools/csv/csv-rows-to-columns/meta.ts +++ b/src/pages/tools/csv/csv-rows-to-columns/meta.ts @@ -9,7 +9,7 @@ export const tool = defineTool('csv', { 'This tool converts rows of a CSV (Comma Separated Values) file into columns. It extracts the horizontal lines from the input CSV one by one, rotates them 90 degrees, and outputs them as vertical columns one after another, separated by commas.', longDescription: 'This tool converts rows of a CSV (Comma Separated Values) file into columns. For example, if the input CSV data has 6 rows, then the output will have 6 columns and the elements of the rows will be arranged from the top to bottom. In a well-formed CSV, the number of values in each row is the same. However, in cases when rows are missing fields, the program can fix them and you can choose from the available options: fill missing data with empty elements or replace missing data with custom elements, such as "missing", "?", or "x". During the conversion process, the tool also cleans the CSV file from unnecessary information, such as empty lines (these are lines without visible information) and comments. To help the tool correctly identify comments, in the options, you can specify the symbol at the beginning of a line that starts a comment. This symbol is typically a hash "#" or double slash "//". Csv-abulous!.', - shortDescription: 'Convert CSV data to JSON format', + shortDescription: 'Convert CSV rows to columns', keywords: ['csv', 'rows', 'columns', 'transpose'], component: lazy(() => import('./index')) }); From caae769a69820f4aa5ddf0667a2c6599f1ce8f0e Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Thu, 10 Apr 2025 15:53:59 +0200 Subject: [PATCH 3/7] fix: icon change (allow right icon for transpose feat) --- src/pages/tools/csv/csv-rows-to-columns/meta.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/tools/csv/csv-rows-to-columns/meta.ts b/src/pages/tools/csv/csv-rows-to-columns/meta.ts index 49dd3bc..4cecc02 100644 --- a/src/pages/tools/csv/csv-rows-to-columns/meta.ts +++ b/src/pages/tools/csv/csv-rows-to-columns/meta.ts @@ -4,7 +4,7 @@ import { lazy } from 'react'; export const tool = defineTool('csv', { name: 'Convert CSV Rows to Columns', path: 'csv-rows-to-columns', - icon: 'carbon:transpose', + icon: 'fluent:text-arrow-down-right-column-24-filled', description: 'This tool converts rows of a CSV (Comma Separated Values) file into columns. It extracts the horizontal lines from the input CSV one by one, rotates them 90 degrees, and outputs them as vertical columns one after another, separated by commas.', longDescription: From c4d78a6c0cdd9d09b73b663219e979185b6e0b63 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Thu, 10 Apr 2025 18:34:04 +0200 Subject: [PATCH 4/7] utils: array util functions (any types) --- src/utils/array.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/utils/array.ts diff --git a/src/utils/array.ts b/src/utils/array.ts new file mode 100644 index 0000000..3ab7c50 --- /dev/null +++ b/src/utils/array.ts @@ -0,0 +1,26 @@ +/** + * Transpose a 2D array (matrix). + * @param {any[][]} matrix - The 2D array to transpose. + * @returns {any[][]} - The transposed 2D array. + **/ + +export function transpose(matrix: T[][]): any[][] { + return matrix[0].map((_, colIndex) => matrix.map((row) => row[colIndex])); +} + +/** + * Normalize and fill a 2D array to ensure all rows have the same length. + * @param {any[][]} matrix - The 2D array to normalize and fill. + * @param {any} fillValue - The value to fill in for missing elements. + * @returns {any[][]} - The normalized and filled 2D array. + * **/ +export function normalizeAndFill(matrix: T[][], fillValue: T): T[][] { + const maxLength = Math.max(...matrix.map((row) => row.length)); + return matrix.map((row) => { + const filledRow = [...row]; + while (filledRow.length < maxLength) { + filledRow.push(fillValue); + } + return filledRow; + }); +} From e48f1757e2ce51137d4e9f209b4037d0a7c0a354 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Thu, 10 Apr 2025 18:39:09 +0200 Subject: [PATCH 5/7] feat: transpose-CSV --- src/pages/tools/csv/index.ts | 4 +- src/pages/tools/csv/transpose-csv/index.tsx | 178 ++++++++++++++++++ src/pages/tools/csv/transpose-csv/meta.ts | 15 ++ src/pages/tools/csv/transpose-csv/service.ts | 27 +++ .../transpose-csv.service.test.ts | 89 +++++++++ src/pages/tools/csv/transpose-csv/types.ts | 7 + 6 files changed, 319 insertions(+), 1 deletion(-) create mode 100644 src/pages/tools/csv/transpose-csv/index.tsx create mode 100644 src/pages/tools/csv/transpose-csv/meta.ts create mode 100644 src/pages/tools/csv/transpose-csv/service.ts create mode 100644 src/pages/tools/csv/transpose-csv/transpose-csv.service.test.ts create mode 100644 src/pages/tools/csv/transpose-csv/types.ts diff --git a/src/pages/tools/csv/index.ts b/src/pages/tools/csv/index.ts index 78ae56b..3e0a9da 100644 --- a/src/pages/tools/csv/index.ts +++ b/src/pages/tools/csv/index.ts @@ -1,3 +1,4 @@ +import { tool as transposeCsv } from './transpose-csv/meta'; import { tool as findIncompleteCsvRecords } from './find-incomplete-csv-records/meta'; import { tool as ChangeCsvDelimiter } from './change-csv-separator/meta'; import { tool as csvToYaml } from './csv-to-yaml/meta'; @@ -15,5 +16,6 @@ export const csvTools = [ swapCsvColumns, csvToYaml, ChangeCsvDelimiter, - findIncompleteCsvRecords + findIncompleteCsvRecords, + transposeCsv ]; diff --git a/src/pages/tools/csv/transpose-csv/index.tsx b/src/pages/tools/csv/transpose-csv/index.tsx new file mode 100644 index 0000000..629cceb --- /dev/null +++ b/src/pages/tools/csv/transpose-csv/index.tsx @@ -0,0 +1,178 @@ +import { Box } from '@mui/material'; +import React, { useState } from 'react'; +import ToolContent from '@components/ToolContent'; +import { ToolComponentProps } from '@tools/defineTool'; +import ToolTextInput from '@components/input/ToolTextInput'; +import ToolTextResult from '@components/result/ToolTextResult'; +import { GetGroupsType } from '@components/options/ToolOptions'; +import { CardExampleType } from '@components/examples/ToolExamples'; +import { transposeCSV } from './service'; +import { InitialValuesType } from './types'; +import TextFieldWithDesc from '@components/options/TextFieldWithDesc'; +import SelectWithDesc from '@components/options/SelectWithDesc'; + +const initialValues: InitialValuesType = { + separator: ',', + commentCharacter: '#', + customFill: false, + customFillValue: 'x', + quoteChar: '"' +}; + +const exampleCards: CardExampleType[] = [ + { + title: 'Transpose a 2x3 CSV', + description: + 'This example transposes a CSV with 2 rows and 3 columns. The tool splits the input data by the comma character, creating a 2 by 3 matrix. It then exchanges elements, turning columns into rows and vice versa. The output is a transposed CSV with flipped dimensions', + sampleText: `foo,bar,baz +val1,val2,val3`, + sampleResult: `foo,val1 +bar,val2 +baz,val3`, + sampleOptions: { + separator: ',', + commentCharacter: '#', + customFill: false, + customFillValue: 'x', + quoteChar: '"' + } + }, + { + title: 'Transpose a Long CSV', + description: + 'In this example, we flip a vertical single-column CSV file containing a list of our favorite fruits and their emojis. This single column is transformed into a single-row CSV file and the rows length matches the height of the original CSV.', + sampleText: `Tasty Fruit +🍑 peaches +🍒 cherries +🥝 kiwis +🍓 strawberries +🍎 apples +🍐 pears +🥭 mangos +🍍 pineapples +🍌 bananas +🍊 tangerines +🍉 watermelons +🍇 grapes`, + sampleResult: `fTasty Fruit,🍑 peaches,🍒 cherries,🥝 kiwis,🍓 strawberries,🍎 apples,🍐 pears,🥭 mangos,🍍 pineapples,🍌 bananas,🍊 tangerines,🍉 watermelons,🍇 grapes`, + sampleOptions: { + separator: ',', + commentCharacter: '#', + customFill: false, + customFillValue: 'x', + quoteChar: '"' + } + }, + { + title: 'Clean and Transpose CSV Data', + description: + 'In this example, we perform three tasks simultaneously: transpose a CSV file, remove comments and empty lines, and fix missing data. The transposition operation is the same as flipping a matrix across its diagonal and it is done automatically by the program. Additionally, the program automatically removes all empty lines as they cannot be transposed. The comments are removed by specifying the "#" symbol in the options. The program also fixes missing data using a custom bullet symbol "•", which is specified in the options.', + sampleText: `Fish Type,Color,Habitat +Goldfish,Gold,Freshwater + +#Clownfish,Orange,Coral Reefs +Tuna,Silver,Saltwater + +Shark,Grey,Saltwater +Salmon,Silver`, + sampleResult: `Fish Type,Goldfish,Tuna,Shark,Salmon +Color,Gold,Silver,Grey,Silver +Habitat,Freshwater,Saltwater,Saltwater,•`, + sampleOptions: { + separator: ',', + commentCharacter: '#', + customFill: true, + customFillValue: '•', + quoteChar: '"' + } + } +]; +export default function TransposeCsv({ + title, + longDescription +}: ToolComponentProps) { + const [input, setInput] = useState(''); + const [result, setResult] = useState(''); + + const compute = (values: InitialValuesType, input: string) => { + setResult(transposeCSV(input, values)); + }; + + const getGroups: GetGroupsType | null = ({ + values, + updateField + }) => [ + { + title: 'Csv input Options', + component: ( + + updateField('separator', val)} + description={ + 'Enter the character used to delimit columns in the CSV input file.' + } + /> + updateField('quoteChar', val)} + description={ + 'Enter the quote character used to quote the CSV input fields.' + } + /> + updateField('commentCharacter', val)} + description={ + 'Enter the character indicating the start of a comment line. Lines starting with this symbol will be skipped.' + } + /> + + ) + }, + { + title: 'Fixing CSV Options', + component: ( + + updateField('customFill', value)} + description={ + 'Insert empty fields or custom values where the CSV data is missing (not empty).' + } + /> + + {values.customFill && ( + updateField('customFillValue', val)} + description={ + 'Enter the character used to fill missing values in the CSV input file.' + } + /> + )} + + ) + } + ]; + return ( + + } + resultComponent={} + initialValues={initialValues} + exampleCards={exampleCards} + getGroups={getGroups} + setInput={setInput} + compute={compute} + toolInfo={{ title: `What is a ${title}?`, description: longDescription }} + /> + ); +} diff --git a/src/pages/tools/csv/transpose-csv/meta.ts b/src/pages/tools/csv/transpose-csv/meta.ts new file mode 100644 index 0000000..2f05e33 --- /dev/null +++ b/src/pages/tools/csv/transpose-csv/meta.ts @@ -0,0 +1,15 @@ +import { defineTool } from '@tools/defineTool'; +import { lazy } from 'react'; + +export const tool = defineTool('csv', { + name: 'Transpose CSV', + path: 'transpose-csv', + icon: 'carbon:transpose', + description: + 'Just upload your CSV file in the form below, and this tool will automatically transpose your CSV. In the tool options, you can specify the character that starts the comment lines in the CSV to remove them. Additionally, if the CSV is incomplete (missing values), you can replace missing values with the empty character or a custom character.', + shortDescription: 'Quickly transpose a CSV file.', + keywords: ['transpose', 'csv'], + longDescription: + 'This tool transposes Comma Separated Values (CSV). It treats the CSV as a matrix of data and flips all elements across the main diagonal. The output contains the same CSV data as the input, but now all the rows have become columns, and all the columns have become rows. After transposition, the CSV file will have opposite dimensions. For example, if the input file has 4 columns and 3 rows, the output file will have 3 columns and 4 rows. During conversion, the program also cleans the data from unnecessary lines and corrects incomplete data. Specifically, the tool automatically deletes all empty records and comments that begin with a specific character, which you can set in the option. Additionally, in cases where the CSV data is corrupted or lost, the utility completes the file with empty fields or custom fields that can be specified in the options. Csv-abulous!', + component: lazy(() => import('./index')) +}); diff --git a/src/pages/tools/csv/transpose-csv/service.ts b/src/pages/tools/csv/transpose-csv/service.ts new file mode 100644 index 0000000..efd0f73 --- /dev/null +++ b/src/pages/tools/csv/transpose-csv/service.ts @@ -0,0 +1,27 @@ +import { InitialValuesType } from './types'; +import { transpose, normalizeAndFill } from '@utils/array'; +import { splitCsv } from '@utils/csv'; + +export function transposeCSV( + input: string, + options: InitialValuesType +): string { + if (!input) return ''; + + const rows = splitCsv( + input, + true, + options.commentCharacter, + true, + options.separator, + options.quoteChar + ); + + const normalizeAndFillRows = options.customFill + ? normalizeAndFill(rows, options.customFillValue) + : normalizeAndFill(rows, ''); + + return transpose(normalizeAndFillRows) + .map((row) => row.join(options.separator)) + .join('\n'); +} diff --git a/src/pages/tools/csv/transpose-csv/transpose-csv.service.test.ts b/src/pages/tools/csv/transpose-csv/transpose-csv.service.test.ts new file mode 100644 index 0000000..887879f --- /dev/null +++ b/src/pages/tools/csv/transpose-csv/transpose-csv.service.test.ts @@ -0,0 +1,89 @@ +import { expect, describe, it } from 'vitest'; +import { transposeCSV } from './service'; +import { InitialValuesType } from './types'; + +describe('transposeCsv', () => { + it('should transpose a simple CSV', () => { + const options: InitialValuesType = { + separator: ',', + commentCharacter: '#', + customFill: false, + customFillValue: 'x', + quoteChar: '"' + }; + const input = 'a,b,c\n1,2,3'; + const expectedOutput = 'a,1\nb,2\nc,3'; + const result = transposeCSV(input, options); + expect(result).toEqual(expectedOutput); + }); + + it('should handle an empty CSV', () => { + const options: InitialValuesType = { + separator: ',', + commentCharacter: '#', + customFill: false, + customFillValue: 'x', + quoteChar: '"' + }; + const input = ''; + const expectedOutput = ''; + const result = transposeCSV(input, options); + expect(result).toEqual(expectedOutput); + }); + + it('should handle a single row CSV', () => { + const options: InitialValuesType = { + separator: ',', + commentCharacter: '#', + customFill: false, + customFillValue: 'x', + quoteChar: '"' + }; + const input = 'a,b,c'; + const expectedOutput = 'a\nb\nc'; + const result = transposeCSV(input, options); + expect(result).toEqual(expectedOutput); + }); + + it('should handle a single column CSV', () => { + const options: InitialValuesType = { + separator: ',', + commentCharacter: '#', + customFill: false, + customFillValue: 'x', + quoteChar: '"' + }; + const input = 'a\nb\nc'; + const expectedOutput = 'a,b,c'; + const result = transposeCSV(input, options); + expect(result).toEqual(expectedOutput); + }); + + it('should handle uneven rows in the CSV', () => { + const options: InitialValuesType = { + separator: ',', + commentCharacter: '#', + customFill: true, + customFillValue: 'x', + quoteChar: '"' + }; + const input = 'a,b\n1,2,3'; + const expectedOutput = 'a,1\nb,2\nx,3'; + const result = transposeCSV(input, options); + expect(result).toEqual(expectedOutput); + }); + + it('should skip comment in the CSV', () => { + const options: InitialValuesType = { + separator: ',', + commentCharacter: '#', + customFill: true, + customFillValue: 'x', + quoteChar: '"' + }; + const input = 'a,b\n1,2\n#c,3\nd,4'; + const expectedOutput = 'a,1,d\nb,2,4'; + const result = transposeCSV(input, options); + expect(result).toEqual(expectedOutput); + }); +}); diff --git a/src/pages/tools/csv/transpose-csv/types.ts b/src/pages/tools/csv/transpose-csv/types.ts new file mode 100644 index 0000000..6d7cd90 --- /dev/null +++ b/src/pages/tools/csv/transpose-csv/types.ts @@ -0,0 +1,7 @@ +export type InitialValuesType = { + separator: string; + commentCharacter: string; + customFill: boolean; + customFillValue: string; + quoteChar: string; +}; From a53dfc7c152d143fb646ab1771358bc95bdfb340 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Thu, 10 Apr 2025 19:02:29 +0200 Subject: [PATCH 6/7] fix: adjusting CSV Meta file for consistency --- src/pages/tools/csv/change-csv-separator/meta.ts | 2 +- src/pages/tools/csv/csv-rows-to-columns/meta.ts | 2 +- src/pages/tools/csv/csv-to-json/meta.ts | 2 +- src/pages/tools/csv/csv-to-tsv/meta.ts | 2 +- src/pages/tools/csv/csv-to-xml/meta.ts | 2 +- src/pages/tools/csv/csv-to-yaml/meta.ts | 2 +- src/pages/tools/csv/find-incomplete-csv-records/meta.ts | 2 +- src/pages/tools/csv/swap-csv-columns/meta.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pages/tools/csv/change-csv-separator/meta.ts b/src/pages/tools/csv/change-csv-separator/meta.ts index 3b4a832..efdbea1 100644 --- a/src/pages/tools/csv/change-csv-separator/meta.ts +++ b/src/pages/tools/csv/change-csv-separator/meta.ts @@ -2,7 +2,7 @@ import { defineTool } from '@tools/defineTool'; import { lazy } from 'react'; export const tool = defineTool('csv', { - name: 'Change csv separator', + name: 'Change CSV separator', path: 'change-csv-separator', icon: 'material-symbols:split-scene-rounded', description: diff --git a/src/pages/tools/csv/csv-rows-to-columns/meta.ts b/src/pages/tools/csv/csv-rows-to-columns/meta.ts index 4cecc02..f126d75 100644 --- a/src/pages/tools/csv/csv-rows-to-columns/meta.ts +++ b/src/pages/tools/csv/csv-rows-to-columns/meta.ts @@ -9,7 +9,7 @@ export const tool = defineTool('csv', { 'This tool converts rows of a CSV (Comma Separated Values) file into columns. It extracts the horizontal lines from the input CSV one by one, rotates them 90 degrees, and outputs them as vertical columns one after another, separated by commas.', longDescription: 'This tool converts rows of a CSV (Comma Separated Values) file into columns. For example, if the input CSV data has 6 rows, then the output will have 6 columns and the elements of the rows will be arranged from the top to bottom. In a well-formed CSV, the number of values in each row is the same. However, in cases when rows are missing fields, the program can fix them and you can choose from the available options: fill missing data with empty elements or replace missing data with custom elements, such as "missing", "?", or "x". During the conversion process, the tool also cleans the CSV file from unnecessary information, such as empty lines (these are lines without visible information) and comments. To help the tool correctly identify comments, in the options, you can specify the symbol at the beginning of a line that starts a comment. This symbol is typically a hash "#" or double slash "//". Csv-abulous!.', - shortDescription: 'Convert CSV rows to columns', + shortDescription: 'Convert CSV rows to columns.', keywords: ['csv', 'rows', 'columns', 'transpose'], component: lazy(() => import('./index')) }); diff --git a/src/pages/tools/csv/csv-to-json/meta.ts b/src/pages/tools/csv/csv-to-json/meta.ts index 6e81b62..94dbae7 100644 --- a/src/pages/tools/csv/csv-to-json/meta.ts +++ b/src/pages/tools/csv/csv-to-json/meta.ts @@ -7,7 +7,7 @@ export const tool = defineTool('csv', { icon: 'lets-icons:json-light', description: 'Convert CSV files to JSON format with customizable options for delimiters, quotes, and output formatting. Support for headers, comments, and dynamic type conversion.', - shortDescription: 'Convert CSV data to JSON format', + shortDescription: 'Convert CSV data to JSON format.', keywords: ['csv', 'json', 'convert', 'transform', 'parse'], component: lazy(() => import('./index')) }); diff --git a/src/pages/tools/csv/csv-to-tsv/meta.ts b/src/pages/tools/csv/csv-to-tsv/meta.ts index 11f2cb2..526a92b 100644 --- a/src/pages/tools/csv/csv-to-tsv/meta.ts +++ b/src/pages/tools/csv/csv-to-tsv/meta.ts @@ -7,7 +7,7 @@ export const tool = defineTool('csv', { icon: 'codicon:keyboard-tab', description: 'Upload your CSV file in the form below and it will automatically get converted to a TSV file. In the tool options, you can customize the input CSV format – specify the field delimiter, quotation character, and comment symbol, as well as skip empty CSV lines, and choose whether to preserve CSV column headers.', - shortDescription: 'Convert CSV data to TSV format', + shortDescription: 'Convert CSV data to TSV format.', longDescription: 'This tool transforms Comma Separated Values (CSV) data to Tab Separated Values (TSV) data. Both CSV and TSV are popular file formats for storing tabular data but they use different delimiters to separate values – CSV uses commas (","), while TSV uses tabs ("\t"). If we compare CSV files to TSV files, then CSV files are much harder to parse than TSV files because the values themselves may contain commas, so it is not always obvious where one field starts and ends without complicated parsing rules. TSV, on the other hand, uses just a tab symbol, which does not usually appear in data, so separating fields in TSV is as simple as splitting the input by the tab character. To convert CSV to TSV, simply input the CSV data in the input of this tool. In rare cases when a CSV file has a delimiter other than a comma, you can specify the current delimiter in the options of the tool. You can also specify the current quote character and the comment start character. Additionally, empty CSV lines can be skipped by activating the "Ignore Lines with No Data" option. If this option is off, then empty lines in the CSV are converted to empty TSV lines. The "Preserve Headers" option allows you to choose whether to process column headers of a CSV file. If the option is selected, then the resulting TSV file will include the first row of the input CSV file, which contains the column names. Alternatively, if the headers option is not selected, the first row will be skipped during the data conversion process. For the reverse conversion from TSV to CSV, you can use our Convert TSV to CSV tool. Csv-abulous!', keywords: ['csv', 'tsv', 'convert', 'transform', 'parse'], diff --git a/src/pages/tools/csv/csv-to-xml/meta.ts b/src/pages/tools/csv/csv-to-xml/meta.ts index 3e34b78..9eea05c 100644 --- a/src/pages/tools/csv/csv-to-xml/meta.ts +++ b/src/pages/tools/csv/csv-to-xml/meta.ts @@ -6,7 +6,7 @@ export const tool = defineTool('csv', { path: 'csv-to-xml', icon: 'mdi-light:xml', description: 'Convert CSV files to XML format with customizable options.', - shortDescription: 'Convert CSV data to XML format', + shortDescription: 'Convert CSV data to XML format.', keywords: ['csv', 'xml', 'convert', 'transform', 'parse'], component: lazy(() => import('./index')) }); diff --git a/src/pages/tools/csv/csv-to-yaml/meta.ts b/src/pages/tools/csv/csv-to-yaml/meta.ts index 9c07601..cccb6d4 100644 --- a/src/pages/tools/csv/csv-to-yaml/meta.ts +++ b/src/pages/tools/csv/csv-to-yaml/meta.ts @@ -2,7 +2,7 @@ import { defineTool } from '@tools/defineTool'; import { lazy } from 'react'; export const tool = defineTool('csv', { - name: 'Csv to yaml', + name: 'Convert CSV to YAML', path: 'csv-to-yaml', icon: 'nonicons:yaml-16', description: diff --git a/src/pages/tools/csv/find-incomplete-csv-records/meta.ts b/src/pages/tools/csv/find-incomplete-csv-records/meta.ts index d3e9752..fc8f165 100644 --- a/src/pages/tools/csv/find-incomplete-csv-records/meta.ts +++ b/src/pages/tools/csv/find-incomplete-csv-records/meta.ts @@ -2,7 +2,7 @@ import { defineTool } from '@tools/defineTool'; import { lazy } from 'react'; export const tool = defineTool('csv', { - name: 'Find incomplete csv records', + name: 'Find incomplete CSV records', path: 'find-incomplete-csv-records', icon: 'tdesign:search-error', description: diff --git a/src/pages/tools/csv/swap-csv-columns/meta.ts b/src/pages/tools/csv/swap-csv-columns/meta.ts index 3a2f378..46911ca 100644 --- a/src/pages/tools/csv/swap-csv-columns/meta.ts +++ b/src/pages/tools/csv/swap-csv-columns/meta.ts @@ -7,7 +7,7 @@ export const tool = defineTool('csv', { icon: 'eva:swap-outline', description: 'Just upload your CSV file in the form below, specify the columns to swap, and the tool will automatically change the positions of the specified columns in the output file. In the tool options, you can specify the column positions or names that you want to swap, as well as fix incomplete data and optionally remove empty records and records that have been commented out.', - shortDescription: 'Reorder CSV columns', + shortDescription: 'Reorder CSV columns.', longDescription: 'This tool reorganizes CSV data by swapping the positions of its columns. Swapping columns can enhance the readability of a CSV file by placing frequently used data together or in the front for easier data comparison and editing. For example, you can swap the first column with the last or swap the second column with the third. To swap columns based on their positions, select the "Set Column Position" mode and enter the numbers of the "from" and "to" columns to be swapped in the first and second blocks of options. For example, if you have a CSV file with four columns "1, 2, 3, 4" and swap columns with positions "2" and "4", the output CSV will have columns in the order: "1, 4, 3, 2".As an alternative to positions, you can swap columns by specifying their headers (column names on the first row of data). If you enable this mode in the options, then you can enter the column names like "location" and "city", and the program will swap these two columns. If any of the specified columns have incomplete data (some fields are missing), you can choose to skip such data or fill the missing fields with empty values or custom values (specified in the options). Additionally, you can specify the symbol used for comments in the CSV data, such as "#" or "//". If you do not need the commented lines in the output, you can remove them by using the "Delete Comments" checkbox. You can also activate the checkbox "Delete Empty Lines" to get rid of empty lines that contain no visible information. Csv-abulous!', keywords: ['csv', 'swap', 'columns'], From 5bc084123a4286ec5bcf5aeee34a1dbd2116e5c0 Mon Sep 17 00:00:00 2001 From: "Ibrahima G. Coulibaly" Date: Thu, 22 May 2025 17:25:50 +0100 Subject: [PATCH 7/7] chore: revert create-tool.mjs --- scripts/create-tool.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/create-tool.mjs b/scripts/create-tool.mjs index 2acbba4..3032f95 100644 --- a/scripts/create-tool.mjs +++ b/scripts/create-tool.mjs @@ -54,7 +54,7 @@ function createFolderStructure(basePath, foldersToCreateIndexCount) { } // Start the recursive folder creation - recursiveCreate('/', 1); + recursiveCreate('.', 0); } const toolNameCamelCase = toolName.replace(/-./g, (x) => x[1].toUpperCase());