By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,667 Members | 1,280 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,667 IT Pros & Developers. It's quick & easy.

CSV formate file

100+
P: 123
Hi .
I dont know in which thread my question should be appropriate , so sorry for that.
I have one data base table , and i am importing all the results of one "email " field into result.txt ,which is in my home directory in unix server..

Now i want that file to be comma seperated,
means all the email should be

like

abc@yahoo.com
bbb@gmail.com
ddd@hotmail.com

something like this..Can u please help me ??

+---------------+
| email |
+---------------+
| |
| |
| |
| |
| abc@yahoo.com |
| email |
+---------------+
May 9 '08 #1
Share this Question
Share on Google+
3 Replies

gpraghuram
Expert 100+
P: 1,275
Hi .
I dont know in which thread my question should be appropriate , so sorry for that.
I have one data base table , and i am importing all the results of one "email " field into result.txt ,which is in my home directory in unix server..

Now i want that file to be comma seperated,
means all the email should be

like

abc@yahoo.com
bbb@gmail.com
ddd@hotmail.com

something like this..Can u please help me ??

+---------------+
| email |
+---------------+
| |
| |
| |
| |
| abc@yahoo.com |
| email |
+---------------+

You want the sql statement output should be formatted like the above or you want to format the contents in a file like the above?

Raghu
May 11 '08 #2

100+
P: 123
You want the sql statement output should be formatted like the above or you want to format the contents in a file like the above?

Raghu
Hi Raghu,
The above output is (result.txt) what I am getting after all the manipulation.
Now i am creating one more file i.e final.txt in which i just want

abc@gmail.com
ddd@yahoo.com


something like that
May 12 '08 #3

gpraghuram
Expert 100+
P: 1,275
Hi Raghu,
The above output is (result.txt) what I am getting after all the manipulation.
Now i am creating one more file i.e final.txt in which i just want

abc@gmail.com
ddd@yahoo.com


something like that
What i understood is you want to convert a newline separated email id's to a comma separated email id's.
If yes the you can do it as

Expand|Select|Wrap|Line Numbers
  1. cat "ip.txt" | tr '\n' ',' > op.txt
  2.  
Raghuram
May 13 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.