NumberList introduced in Text files

When we save a text document using Aspose, NumberList is getting added to the text document even if we have not set the autonumbering option.

For Example, if we have a text file as,
1 Hello
2 world

and we save this text file using aspose as a text file the output text file looks like,

  1. hello
  2. world

Where a period is added after the number when saved using aspose.

The screenshots of the file before and after the file has run through the code is attached below along with the zip file of the code used, Can anyone help me on this?

input_as_seen_in_text.PNG (496 Bytes)
ouput_as_seen_in_text.PNG (531 Bytes)
Zip file of the code- AsposeTestApp.zip (5.1 MB)

Thanks in advance,
Rajesh

@Rajesh_Suresh,

We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-19325. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

@Rajesh_Suresh,

Regarding WORDSNET-19325, it is to update you that the analysis reveals the following:

If you do not want to detect numbering with white-spaces, then it is not enough to use the following code:

Document doc = new Document("C:\\in.txt");
doc.Save("C:\\out.txt", SaveFormat.Text);

Please use the following code instead:

TxtLoadOptions loadOptions = new TxtLoadOptions();
loadOptions.DetectNumberingWithWhitespaces = false;
Document doc = new Document("C:\\in.txt", loadOptions);
doc.Save("C:\\out.txt", SaveFormat.Text);

So, even if you have not set the auto-numbering option, this option (DetectNumberingWithWhitespaces) is set to ‘true’ by default. Please just set it to ‘false’ explicitly to be able to get the desired results.

Hope, this helps.

@awais.hafeez,
thanks for the update, will try this.

@awais.hafeez,
I had another question, is there a way to apply this property “DetectNumberingWithWhitespaces” when viewing (read-only) the document. Meaning, if documents that were previously saved with this value as “True”, is there a way we can view this document without the periods (if that was how they were originally saved?).

@Rajesh_Suresh,

Your original .txt file does not have periods and when you load it in Aspose.Words by using Document doc = new Document("C:\\in.txt"); it will add periods in loaded document. And when you use the following code, the periods will not be added:

TxtLoadOptions loadOptions = new TxtLoadOptions();
loadOptions.DetectNumberingWithWhitespaces = false;
Document doc = new Document("C:\\in.txt", loadOptions);
doc.Save("C:\\out.txt", SaveFormat.Text);

Hope, this helps.

Thanks for the info.