Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1678
  • Last Modified:

Carriage Return Unix Format CSV file

Hello

Does anyone know how i can export data from sql server 2005 and create a carriage return (unix format) csv file, which is generated from a query.

While this is done it is to be sheduled using a job, and an incremental file name will be created any time a job is excuted.
filenames will be xxx0001 (if executed today), xxx0002(if executed tomorrow), xxx0003 (if executed the day after)

Also the files will be dumped at a shared gateway server
0
M_Boy76
Asked:
M_Boy76
  • 5
  • 4
  • 2
  • +1
1 Solution
 
jogosCommented:
In SQL*Server import/export is done by MSIS, see books online
http://msdn.microsoft.com/en-us/library/ms141026(SQL.90).aspx
0
 
HoggZillaCommented:
In the example I provided for you, make sure you select the configuration options of the Flat File destination to meet your needs. Once the wizard creates your package, double-click on the DestinationConnectionFlatFile Connection Manager and you can modify. If you do find a modification is necessary, I find it easier most times to create a new package using the wizard and select the correct options in the wizard.
flat-file-editor.bmp
0
 
M_Boy76Author Commented:
Sory, not much info in the link you sent
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
M_Boy76Author Commented:
HoggZilla:

I did it that way but still it doesnt create the carraiage return unix csv format
0
 
HoggZillaCommented:
Following the steps I layed out, I created a flat file with CRLF at the end of each row and the columns are separated by commas - thus the. Perhaps you could explain exactly the format you are looking for in the file. This is CRLF csv:
colA,colB,colC,colD
colA,colB,colC,colD
..
Post an example of the file output please.
0
 
M_Boy76Author Commented:
Here is the format, i had to save it as an xls spreadsheet since we cant attach csv file extensions
sample-format.xls
0
 
jogosCommented:
"Sory, not much info in the link you sent"
Entry point of SSIS in books online -> you have to navigate to get a pictiure of what it does, how you can do it .... until download examples.
Your question did not mention you knew it at all. HoggZilla kindly provided you with the endpoint off the output.

Flatfile -> .TXT. If you export to XLS you won't be meeting your Unix-requirements.
0
 
HoggZillaCommented:
You will need to attach the file by adding a .txt to the end of the file name. Example. sample-format.csv.txt
The file you sent is a real .xls - not a .csv. Thanks
0
 
HoggZillaCommented:
I think the issue is in your select statement. Change it to columns, not a comma separated string.
0
 
Anthony PerkinsCommented:
>>create a carriage return (unix format) csv file<<
You need to use Lf instead of Cr+Lf
0
 
Anthony PerkinsCommented:
Let me rephrase that:
Your row delimiter needs to be Lf instead of Cr+Lf
0
 
M_Boy76Author Commented:
will this give me a line feed carriage return csv file
0
 
HoggZillaCommented:
Let the receiving program or destination determine what is required of your .csv file. Making the change between CrLf to Lf is just selecting the appropriate value from the dropdown box. Picture above. Here is a link I have used to debug .csv file issues.
http://www.csvreader.com/csv_format.php
 
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now