x

How to eliminate Extra commas at the end in CSV file,which exported from SSRS

I'm just Exporting SSRS report to CSV format,where i'm getting extra commas at end of each record as

CSV Format:

274,98027,Issaquah
274,502097814,M
43849,SO43849,
44082,SO44082,
44508,SO44508,
44532,SO44532,

The extra comma appearing at end of rows in "CSV format",for the rows which has NULL values at end in the "Report"

Report Format:

274 98027 Issaquah
274 502097814 M
43849 SO43849 NULL
44082 SO44082 NULL
44508 SO44508 NULL
44532 SO44532 NULL

Is there any solution to hide extra comma in CSV format?

plz suggest solution for this.

Thanks in advance..

more ▼

asked May 04, 2015 at 12:47 PM in Default

avatar image

Kavin
1 2 1 3

The comma doesn't really look like it's 'extra' since there is a column that comes after it.

If that column is always null, can you just remove it from the report? The columns in the report/CSV look like they hold different things - maybe each type of row could go into its own csv?

May 04, 2015 at 01:44 PM KenJ

Like KenJ said before, comma at the end of row in your csv is for reason. Csv formated like this is correct, and if you do any operation with that csv file, it'll work. But if you delete commas at the end of some rows, in that case your csv will differ from your real data in database.

May 04, 2015 at 02:08 PM Sule

thx for reply.Yah as if for our requirement.we did query in recursive CTE .where first row from different statement and second,third(with different no. of columns in select).i have hided the null value columns in the report.and that columns are not visible.is there any other solution available?plz suggest..

May 04, 2015 at 04:10 PM Kavin
(comments are locked)
10|1200 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x136
x116
x36
x16
x9

asked: May 04, 2015 at 12:47 PM

Seen: 849 times

Last Updated: May 04, 2015 at 04:11 PM

Copyright 2017 Redgate Software. Privacy Policy