Comments (5)
I specifically didn't want new line characters to create multiple rows in Excel, simply because I wanted to test it on large input sets, and creating additional rows made verification significantly harder.
Replacing " with "" might well make sense, though I would need to test it.
Do you have any specific reason for these requests?
Dijji
from xstreader.
IMHO, exporting task should preserve as much information as possible.
Deleting newline changes meaning, especially original message header.
I understand about test, but excel and other CVS related tools can read without problem and
test with such tools is far better than checking with human eyes.
My patch was WIP and not checked, sorry.
Now I have correct source code to solve this issue, and soon commit it.
It is checked by exporting folders and reading by excel. The forlders have >10,000 messages including plain text and HTML with multilingual text in Japanese.
--HAL
from xstreader.
I had the same need that @halueda, trying to preverse as much as possible all the values.
I believe the commit from @halueda is checking twice \n
(instead of - I assume - checking \n
and \r
) :
... value.Contains("\n") || value.Contains("\n") ...
Also for some reason, Excel doesn't open the CSV correctly, and requires the current locale separator instead of a plain comma. I'm not sure if Excel complies with the RFC 4180 with such a behavior. I had to locally modify the code like so to make it work for me. Even though this is probably not a change you want to incorporate officially (or through a setting only maybe).
private void AddCsvValue(StringBuilder sb, string value, ref bool hasValue)
{
string comma = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator; // ",";
if (hasValue) sb.Append(comma);
if (value != null)
{
bool escape = value.Contains(comma) || value.Contains("\"") || value.Contains("\r") || value.Contains("\n");
if (escape) value = "\"" + value.Replace("\"", "\"\"") + "\"";
sb.Append(value);
}
hasValue = true;
}
from xstreader.
Thank you for reminding me of the work done by halueda on multilanguage support when exporting to csv files. I should have merged the changes long ago. So now I have. However, I did not include the changes to add the body in some form to the csv file, as there are other, higher fidelity, ways to get this information already.
I have also incorporated your change to make the comma culturally sensitive in the changes for the next release. I don't mind diverging somewhat from an RFC that is observed strictly almost nowhere, as I think that Excel is almost certainly the dominant scenario for reading such files.
Thank you for raising the issues that you encountered, and fixing them too!
Dijji
from xstreader.
Changes released as version 1.11
from xstreader.
Related Issues (20)
- Can open password protected .pst files with out supplying password. HOT 9
- Support for exporting to EML w/attachments HOT 5
- Commandline parsing to CSV? HOT 2
- Feature Request: Open/Search Multiple Files HOT 2
- "Sub-nodes of sub-nodes not yet implemented" crash in pst file with embedded message attachment HOT 7
- Few queries HOT 4
- HTML Export to the same folder structure HOT 2
- Duplicate Dictionary Key Exception During Processing of Certain Messages with Multiple Attachments HOT 3
- Feature Request: Open a MSG File and extract their properties HOT 1
- VirusTotal HOT 3
- Extract permanently deleted items HOT 2
- OST/PST encryption/compression HOT 1
- XstExport command usage HOT 1
- Feature Request: Bulk import HOT 1
- Sad news about Dijji HOT 6
- Timestamp in UTC HOT 2
- New Release in the iluvadev fork
- Feature request - viewing accents HOT 1
- there is no xstreader.exe to open
- OST to PST
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xstreader.