@@ -5,7 +5,7 @@ author: normesta
5
5
ms.subservice : data-lake-storage-gen2
6
6
ms.service : storage
7
7
ms.topic : how-to
8
- ms.date : 04/11 /2022
8
+ ms.date : 06/09 /2022
9
9
ms.author : normesta
10
10
ms.reviewer : jamsbak
11
11
ms.custom : devx-track-csharp, devx-track-azurepowershell
@@ -241,10 +241,25 @@ private static async Task DumpQueryCsv(BlockBlobClient blob, string query, bool
241
241
{
242
242
try
243
243
{
244
- var options = new BlobQueryOptions () {
245
- InputTextConfiguration = new BlobQueryCsvTextOptions () { HasHeaders = headers },
246
- OutputTextConfiguration = new BlobQueryCsvTextOptions () { HasHeaders = true },
247
- ProgressHandler = new Progress <long >((finishedBytes ) => Console .Error .WriteLine ($" Data read: {finishedBytes }" ))
244
+ var options = new BlobQueryOptions ()
245
+ {
246
+ InputTextConfiguration = new BlobQueryCsvTextOptions ()
247
+ {
248
+ HasHeaders = true ,
249
+ RecordSeparator = " \n " ,
250
+ ColumnSeparator = " ," ,
251
+ EscapeCharacter = '\\ ' ,
252
+ QuotationCharacter = '"'
253
+ },
254
+ OutputTextConfiguration = new BlobQueryCsvTextOptions ()
255
+ {
256
+ HasHeaders = true ,
257
+ RecordSeparator = " \n " ,
258
+ ColumnSeparator = " ," ,
259
+ EscapeCharacter = '\\ ' ,
260
+ QuotationCharacter = '"' },
261
+ ProgressHandler = new Progress <long >((finishedBytes ) =>
262
+ Console .Error .WriteLine ($" Data read: {finishedBytes }" ))
248
263
};
249
264
options .ErrorHandler += (BlobQueryError err ) => {
250
265
Console .ForegroundColor = ConsoleColor .Red ;
@@ -256,7 +271,8 @@ private static async Task DumpQueryCsv(BlockBlobClient blob, string query, bool
256
271
query ,
257
272
options )).Value .Content ))
258
273
{
259
- using (var parser = new CsvReader (reader , new CsvConfiguration (CultureInfo .CurrentCulture , hasHeaderRecord : true ) { HasHeaderRecord = true }))
274
+ using (var parser = new CsvReader
275
+ (reader , new CsvConfiguration (CultureInfo .CurrentCulture ) { HasHeaderRecord = true }))
260
276
{
261
277
while (await parser .ReadAsync ())
262
278
{
@@ -267,7 +283,7 @@ private static async Task DumpQueryCsv(BlockBlobClient blob, string query, bool
267
283
}
268
284
catch (Exception ex )
269
285
{
270
- Console . Error . WriteLine (" Exception: " + ex .ToString ());
286
+ System . Windows . Forms . MessageBox . Show (" Exception: " + ex .ToString ());
271
287
}
272
288
}
273
289
0 commit comments