locked
Strange characters in DSC File Set with .ToDsc RRS feed

  • Question

  • 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
    Tuesday, October 4, 2011 7:46 PM

Answers

  • 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
    Wednesday, October 12, 2011 1:59 PM

All replies

  • 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

    Saturday, October 8, 2011 12:48 PM
  • 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
    Wednesday, October 12, 2011 1:59 PM