Convert a *.dat file to a *.csv file

Solved
Matii_75 Posted messages 22 Status Member -  
 Papy nice -
Hello,

I am looking for how to convert a *.dat file to a *.csv file for import into a MySQL database.

Thank you
Configuration: Linux Konqueror 3.5

3 answers

jipicy Posted messages 40842 Registration date   Status Moderator Last intervention   4 898
 
It is enough to replace each tab with a semicolon :
sed 's/\t/;/g' source_file.dat > output_file.csv
;-))

--
JP - Penguin breeder -
Do something for the environment, close your windows and adopt a penguin.
8
Matii_75 Posted messages 22 Status Member 1
 
Impeccable, thanks. Well, the insertion into the table is still a work in progress, but it's already something.

Thanks.
0
jipicy Posted messages 40842 Registration date   Status Moderator Last intervention   4 898
 
Hi,

What does your .dat file look like?

--
JP - Penguin breeder -
Do your part for the environment, close your windows and adopt a penguin.
0
Matii_75 Posted messages 22 Status Member 1
 
A large amount of data, in the following format:

8:0:46:b0:17:96 10.0.0.1 1113552067
0:8:5:7c:82:16 10.17.0.218 1207067849 eth0
0:c0:9f:7a:a6:8d 164.34.26.13 1170829191
8:0:46:b0:17:96 164.34.20.13 1113557065

All separated by tabs.
0
Papy nice
 
Hello,

I just migrated from a PC running Windows XP to a PC running Windows Vista.
On XP, I had a provided address book that worked with Palm and was in *.dat format.
It has been transferred to Vista, but I want to move away from Palm and import my *.dat into "Windows Contacts".
However, the latter is asking me to first convert *.dat to *.csv.
I’m willing to do it, but how do I go about it?
If anyone can help, that would be nice. Thanks in advance
Papy Nice
0