Strange characters in DSC File Set with .ToDsc
-
2011年10月4日 19:46
I am creating a new File Set from an exisiting file set. My line record is tab delimited. I am adding 3 fields to the beginning of each record. My Linq Query is as follows:
string fileVersion = "1.0";
string recordVersion = "1.0";
string sourceVersion = "sourcesystem_2011-08-31_00_001";var DSCFileSetData = context.FromDsc<LineRecord>(inputDSCFileSet)
.Select(r => String.Concat(sourceVersion, '\t', fileVersion, '\t', recordVersion, '\t', r.ToString())).Skip(1)
.ToDsc(outputDSCFileSet)
.SubmitAndWait(context);If I execute the query in Linqpad and not create the file set, the data looks correct.
1.0 1.0 1314749219 ss ja,en;q=0.5 2011-08-31 00:06:59 2681877029674091487 ...
After creating the file set, when i query the new file set data, it returns some strange characters in the start of the line.
��□□ 1.0 1.0 1314749219 ss ja,en;q=0.5 2011-08-31 00:06:59 2681877029674091487 ...
Any ideas?
--Patrick Gallucci
全部回复
-
2011年10月8日 12:48
It's probably the Unicode Byte Order Mark (or BOM).
See the remarks section here: http://msdn.microsoft.com/en-us/library/system.io.streamwriter.aspx
-
2011年10月12日 13:59
Thanks Jesse, Not sure. I did just see this in the Programmers guide on page 45.
Note: The LINQ Concat operator is not supported by LINQ to HPC.
I changed the code to
sourceVersion + ' ' + recordVersion + ' ' + r.ToString().Skip(1)
And it seems to work....
--Patrick Gallucci- 已标记为答案 Patrick Gallucci 2011年10月12日 13:59

