Skip to content

Commit dd9cadb

Browse files
committed
Fixed width positions, leave out position 0
Fixed width, absolute position 0 is not explicitely needed bc it is always implicitly assumed + fix url in documentation
1 parent 457fcbe commit dd9cadb

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

CSVLintNppPlugin/CsvLint/CsvDefinition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ public string ConstructLine(List<string> values, bool iscomment)
12051205
/// <param name="abspos"> absolute column positions or column widths</param>
12061206
public string GetColumnWidths(bool abspos)
12071207
{
1208-
var res = (abspos ? "0, " : "");
1208+
var res = "";
12091209
var colwidth = 0;
12101210

12111211
for (int c = 0; c < Fields.Count; c++)

CSVLintNppPlugin/CsvLint/CsvGenerateCode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static void GenerateSchemaJSON(CsvDefinition csvdef)
8181
// file format
8282
jsonmeta.Append("\t\"dialect\": {");
8383
if (csvdef.Separator == '\0')
84-
jsonmeta.Append(string.Format("\r\n\t\t\"columnpositions\": [{0}]", csvdef.GetColumnWidths(true)));
84+
jsonmeta.Append(string.Format("\r\n\t\t\"columnpositions\": [0, {0}]", csvdef.GetColumnWidths(true)));
8585
else
8686
jsonmeta.Append(string.Format("\r\n\t\t\"delimiter\": \"{0}\"", separator));
8787
jsonmeta.Append(string.Format(",\r\n\t\t\"header\": \"{0}\"", (csvdef.ColNameHeader ? "true" : "false")));

docs/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ datatypes, and it is meant as a starting point for further script development in
605605

606606
### PowerShell ###
607607

608-
Generates a [PowerShell](https://en.wikipedia.org/wiki/PowerShell/) script to read the csv data file
608+
Generates a [PowerShell](https://en.wikipedia.org/wiki/PowerShell) script to read the csv data file
609609
as a dataset variable. It contains the required scripting for the appropriate
610610
datatypes, and it is meant as a starting point for further script development.
611611

0 commit comments

Comments
 (0)