Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.

ล็อกแล้ว Strange characters in DSC File Set with .ToDsc

  • 4 ตุลาคม 2554 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

ตอบทั้งหมด

  • 8 ตุลาคม 2554 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

  • 12 ตุลาคม 2554 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 12 ตุลาคม 2554 13:59
    •