CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
convert .dat file to .csv file

 



abhi9845
Novice

May 12, 2009, 5:10 AM

Post #1 of 11 (8587 views)
convert .dat file to .csv file Can't Post

Hi,

Could anyone please help me with a script that converts a .dat file to .csv file.

I need it urgently.



Thanks in advance.
Thanks
Abhishek Srivastava


alex_v2
User

May 12, 2009, 10:04 AM

Post #2 of 11 (8582 views)
Re: [abhi9845] convert .dat file to .csv file [In reply to] Can't Post

It would be helpful if you posted a small piece of the .dat file you want to make a csv. Most of the time these kinds of conversions are pretty simple but you need to know the data you are working with.

-Alexander


abhi9845
Novice

May 12, 2009, 10:16 PM

Post #3 of 11 (8575 views)
Re: [alex_v2] convert .dat file to .csv file [In reply to] Can't Post

Hi,



Thanks for your reply, please find the attachment for the dat file.
Thanks
Abhishek Srivastava
Attachments: TEST.dat (5.13 KB)


KevinR
Veteran


May 12, 2009, 10:20 PM

Post #4 of 11 (8573 views)
Re: [abhi9845] convert .dat file to .csv file [In reply to] Can't Post

That file is already in csv format. So all you need to do is change the file extension to .csv
-------------------------------------------------


abhi9845
Novice

May 13, 2009, 5:10 AM

Post #5 of 11 (8563 views)
Re: [KevinR] convert .dat file to .csv file [In reply to] Can't Post

Hi,

Thanks for ur reply.

Please find the attachment for the dat file.

I need to copy the dat file from one unix box to another unix box at daily 2:00AM and it should be copied as csv file using SSH.

For eg:From server2 it should connect to server 1 and it should get the test.dat file from server1 and it should be converted to test.csv and it should be copied in server2 using SSH.
Thanks
Abhishek Srivastava
Attachments: test.dat (24.1 KB)


alex_v2
User

May 13, 2009, 7:40 AM

Post #6 of 11 (8559 views)
Re: [abhi9845] convert .dat file to .csv file [In reply to] Can't Post

The easiest way to do this would be to set up a user on both boxes and install the right ssh key so that it can use ssh without a key. Then set up a cron to run at 2 every day. This can be done with a very simple .sh file.

Something like scp /home/user/test.dat user@server2:/home/user/test.csv

Edit: I had to switch the params around. That is what happens when I type things out to early.

-Alexander


(This post was edited by alex_v2 on May 13, 2009, 1:18 PM)


KevinR
Veteran


May 13, 2009, 12:06 PM

Post #7 of 11 (8555 views)
Re: [abhi9845] convert .dat file to .csv file [In reply to] Can't Post


In Reply To
Hi,

Thanks for ur reply.

Please find the attachment for the dat file.

I need to copy the dat file from one unix box to another unix box at daily 2:00AM and it should be copied as csv file using SSH.

For eg:From server2 it should connect to server 1 and it should get the test.dat file from server1 and it should be converted to test.csv and it should be copied in server2 using SSH.


That has nothing to do with perl. Ask on a Unix forum how to do Unix stuff.
-------------------------------------------------


abhi9845
Novice

May 13, 2009, 11:31 PM

Post #8 of 11 (8545 views)
Re: [KevinR] convert .dat file to .csv file [In reply to] Can't Post

Thanks for your suggestion.

You can plz overlook this thread and carry on with your own work. Need Not interfere with this thread when you have no suggestions or solutions.

I hope I do not here from you again.
Thanks
Abhishek Srivastava


abhi9845
Novice

May 13, 2009, 11:55 PM

Post #9 of 11 (8542 views)
Re: [alex_v2] convert .dat file to .csv file [In reply to] Can't Post

Thanks for your reply Alexandar. It worked wonderfully.

I m able to convert the .dat to .csv file now, but while running the script its asking for password, if ssh is enabled means it wont ask password???, I m not sure about it, please let me know the same.

Weather is there any possiblity to run the script without giving the password??

Hope to hear soon.
Thanks
Abhishek Srivastava


alex_v2
User

May 14, 2009, 12:22 AM

Post #10 of 11 (8538 views)
Re: [abhi9845] convert .dat file to .csv file [In reply to] Can't Post

As I stated before you need to use SSH keys to make ssh work from one machine to another without a password.

First you need to know if you are running ssh1 or ssh2 since the way you use keys is different. The following documentation should help you out.

http://www.sshkeychain.org/mirrors/SSH-with-Keys-HOWTO/

-Alexander


KevinR
Veteran


May 14, 2009, 1:22 AM

Post #11 of 11 (8533 views)
Re: [abhi9845] convert .dat file to .csv file [In reply to] Can't Post


In Reply To
Thanks for your suggestion.

You can plz overlook this thread and carry on with your own work. Need Not interfere with this thread when you have no suggestions or solutions.

I hope I do not here from you again.


I will be more than happy to ignore you. One less jerk to worry about. Please return the favor.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives