How To Save A File As A .cvs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How To Save A File As A .cvs
# 1  
Old 10-03-2012
How To Save A File As A .cvs

Hello. I have a file of text with columns:
Code:
aaaa bbbb ccc dddd
aaaa bbbb ccc dddd
aaaa bbbb ccc dddd

How can this be converted to a .csv file?

Thanks

Last edited by Scott; 10-03-2012 at 05:27 PM.. Reason: Code tags around input file
# 2  
Old 10-03-2012
Try:
Code:
tr " " "," < file > file.csv

This User Gave Thanks to bartus11 For This Post:
# 3  
Old 10-03-2012
Code:
sed -e 's/ /,/g' <file >file.csv

This User Gave Thanks to ramky79 For This Post:
# 4  
Old 10-03-2012
Thank you bartus and ramky!
# 5  
Old 10-04-2012
Code:
 
awk '{gsub(" ",",")}1' input.txt output.csv

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

CVS: can not checkout a newly added file

My project is on solaris 10 using cvs 1.12.13. A team member has added a new file to the repo using the add command followed by commit. When another team member executes the status command in the directory containing the new file they do not get notifiction that there is a file that needs to be... (0 Replies)
Discussion started by: twk
0 Replies

2. Programming

How to create a new file in a CVS repository

I have a coding project that I'm working on, and I'm tracking revisions using CVS. I'm working on a branch (branch1) at version 1.1.2.1. Anyway, I created a new C file in the directory for the project, but I can't commit it. The tutorial I read on CVS said that version numbers will be assigned... (6 Replies)
Discussion started by: Ultrix
6 Replies

3. Programming

updating data in cvs file using c programming

hi every one i want to read and write data from cvs file using c program. but my problem is that at run time my data is increasing in both row wise and column wise. that means it is continuously updating in both direction. is there any way through which i can find the next colum or row for eg... (0 Replies)
Discussion started by: sajidtariq
0 Replies

4. Shell Programming and Scripting

Save cURL verbose output to file or do it like browser "save as.."

hi there ! i have exactly the same problem like this guy here https://www.unix.com/shell-programming-scripting/127668-getting-curl-output-verbose-file.html i am not able to save the curl verbose output.. the sollution in this thread (redirecting stderr to a file) does not work for me.... (0 Replies)
Discussion started by: crabmeat
0 Replies

5. Shell Programming and Scripting

Problem in attaching CVS file to the mail

i wrote this code(( cat $REPORT_EMAIL;uuencode <$OUTFILE $OUTFILE ) | mailx -s "Auto Policy Attach Report Before batch job " $SUPPORT_EMAIL_GRP) in my shell script to attach afile but in the mail i donot get a attachment contais of the mail is Auto Policy Attach Report Before batch job... (0 Replies)
Discussion started by: alokjyotibal
0 Replies

6. UNIX for Dummies Questions & Answers

Copy a windows CVS file to the unix server as a svs file

I so desperately need a script to copy a windows csv file to my unix server and i know these should be at dummies but i have no bits. it is life & no job situation help please. thanks (1 Reply)
Discussion started by: zhegal
1 Replies

7. Shell Programming and Scripting

CVS file operation in Perl

Hi All, I have one CVS file, and doing some actions on it. I have removed some columns by SWITCH: { $column eq 'COL1' && do {next;}; $column eq 'COL2' && do {next;}; push(@columns, $column); ... (1 Reply)
Discussion started by: gentleDean
1 Replies

8. Shell Programming and Scripting

Filter out lines of a cvs from values from an other file

Hi there, I have a comma seperated file which looks like 16-Jun-08,KLM forwarder,,AMS,DXB,AMS,C,Y,G10,074-02580900,milestone failed - message not received,C,OK,,13/06/2008 00:00,KL427,13/06/2008 00:00,KL427,Rebooked,C,milestone failed - message not received,milestone failed - evented... (3 Replies)
Discussion started by: sickboy
3 Replies

9. Shell Programming and Scripting

script grabbing cvs file .....

how do I write a script to checkout a file in cvs and cat the file into a file in my home directory Commands are cd /home/smr/sandbox cvsroot choose option 1 cvs co filename cat filename > /home/smr/newfilename Thank you! (4 Replies)
Discussion started by: llsmr777
4 Replies

10. UNIX for Advanced & Expert Users

Adding a CVS tag to a new file

All, I've been working with perl scripts and shell scripts for quite some time now. I've been making code changes and submitting them into cvs. But I've never created a new file and added it to the directory tree. I know the cvs commands to add it to the directory tree. What I don't know is... (1 Reply)
Discussion started by: rahulrathod
1 Replies
Login or Register to Ask a Question