예제 #1
0
 private static void DefineProcess7(ISingleStream <string> stream)
 {
     stream
     .CrossApply("produce a list of dummy values for ", _ => Enumerable.Range(0, 100).Select(idx => new { Index = idx, Name = $"Index {idx}", CategoryId = idx % 3 }))
     .GroupBy("process per group", i => i.CategoryId)
     .Select("create file", rows => FileValueWriter
             .Create($"otherFileExport{rows.FirstValue.CategoryId}.txt")
             .WriteLine($"here is the list of indexes in the category {rows.FirstValue.CategoryId}")
             .Write(String.Join(", ", rows.Aggregation.Select(row => row.Name).ToList())))
     .WriteToFile("write to folder", i => i.Name);
 }
 public ToFileValueStreamNode(string name, ToTextDataStreamArgs <TIn, TRow> args) : base(name, args)
 {
     _serialize    = args.Mapping.GetSerializer();
     _streamWriter = FileValueWriter.Create(new FlatFileValueMetadata
     {
         Map           = _serialize.GetTextMapping(),
         ExtraMetadata = args.Metadata,
         Destinations  = args.Destinations,
     }, args.FileName, args.Encoding ?? Encoding.Default, 1024);
     _streamWriter.WriteLine(args.Mapping.GenerateDefaultHeaderLine());
 }
예제 #3
0
        private static void DefineProcess3(ISingleStream <string> stream)
        {
            var streamOfRows = stream
                               .CrossApply("produce a list of dummy values for ", _ => Enumerable.Range(0, 100).Select(idx => new { Index = idx, Name = $"Index {idx}", CategoryId = idx % 3 }));

            var fileStream = streamOfRows
                             .ToList("aggregate all rows")
                             .Select("create file", rows => FileValueWriter
                                     .Create("fileExport.txt")
                                     .WriteLine("this content has no specific format")
                                     .Write(String.Join(", ", rows.Select(row => row.Name).ToList())));

            fileStream.WriteToFile("write to folder", i => i.Name);
        }
예제 #4
0
        private static void DefineProcess2(ISingleStream <string> stream)
        {
            var connectionParameters = new Paillave.Etl.Ftp.FtpAdapterConnectionParameters
            {
                Server   = "my.ftp.server",
                Login    = "******",
                Password = "******",
            };
            var providerParameters = new Paillave.Etl.Ftp.FtpAdapterProviderParameters
            {
                SubFolder = "filesToPick"
            };

            stream.Select("create file", _ => FileValueWriter
                          .Create("fileExport.csv")
                          .Write("Here is the content of the file"))
            .WriteToFile("write to folder", i => i.Name);
            stream
            .CrossApply("azeazea", new Paillave.Etl.Ftp.FtpFileValueProvider("SRC", "Misc Source files", "files from ftp", connectionParameters, providerParameters))
            .Do("print file name to console", i => Console.WriteLine(i.Name));
        }