how to add CRLF support for CSV file generated in unix

Tags
csv, file, programming, unix

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 04-07-2008
how to add CRLF support for CSV file generated in unix

Helo,

my server side system is running on a redhat linux o.s.
I have c program on the server which export list file into CSV format. now,
I want that my program on server side is able to add support for
CRLF(carriage return Line feed)into csv file format. so how do i write C program whcih adds a CRLF support for csv file.

Regards,
Amit
# 2  
Old 04-07-2008
The simplest way is to add a line AFTER the output file has been closed.:
Code:
system("ux2dos  withcrlf.csv > withcrlf.csv");

# 3  
Old 04-07-2008
Show server-side source

Without looking at the server-side code that exports the list file into CSV format it is not possible to say if it can be done.
# 4  
Old 04-07-2008
If you have the source, change all occurrences of \n to \r\n, maybe conditionally if you want that.
Login to Reply

|

Similar Threads More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Views How to replace a CRLF char from a variable length file in the middle of a string in UNIX? chandrath UNIX for Beginners Questions & Answers 7 09-06-2018 03:56 PM
Error message while openning the xls file generated by UNIX karthik adiga Shell Programming and Scripting 2 01-12-2017 02:10 PM
Sorting file with CRLF within field, RS=$ alfredo123 Shell Programming and Scripting 6 02-01-2016 03:11 PM
Generated csv files size are more than 3GB sunny13392 Shell Programming and Scripting 1 08-04-2013 06:33 AM
How to read variable length file on UNIX generated by Mainframe? SundarGampa UNIX for Advanced & Expert Users 2 04-20-2013 12:18 PM
Confusion with CRLF (wint) and LF (unix) as end of line seperators sarbjit UNIX for Dummies Questions & Answers 5 05-20-2011 05:59 PM
Script to Grep column 3 from csv file generated yesterday sureshcisco Shell Programming and Scripting 7 01-26-2011 10:42 AM
Issue with a file that contains CRLF Pablo_beezo Shell Programming and Scripting 14 11-19-2009 08:15 AM
Converting hex value 7C (for pipe) to CRLF in Unix sfedak Shell Programming and Scripting 4 01-21-2009 03:49 PM
Add multiple .csv files as sheets to an excel file in unix. libin4u2000 Shell Programming and Scripting 2 01-20-2009 11:20 PM
Issues in the Format in excel file generated from unix machine Vijay06 Shell Programming and Scripting 10 12-12-2007 02:33 AM
Add CRLF is probably simple! Skyybugg Shell Programming and Scripting 1 04-05-2007 12:34 PM
How to FTP a file generated at UNIX Box to NT Box Ruchir UNIX for Advanced & Expert Users 2 08-11-2005 06:55 AM
What file types does unix support? dgames UNIX for Dummies Questions & Answers 3 10-28-2003 11:48 AM
linking unix generated text file to html page alexd Shell Programming and Scripting 1 11-13-2002 12:21 PM
All times are GMT -4. The time now is 08:53 AM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?