I uploaded a .dat file from sftp to my server and after using dos2unix to convert the file and check my work it says that the file was not transferred correctly and that the content is garbled. Please help
I don't think we're dealing with "converting sth. to UNIX". .dat files usually are binary files with an underlying structure understood (more or less) only by the creating and consuming application(s). They are not text files. dos2unix does not apply / do any valuable work. In contrary, it will garble the data.
So, a binary transfer is a must, and on the receiving side an apt application should read, evaluate, and use the binary data. You may want to (binary) compare files before and after transfer.
Location: Asia Pacific, Cyberspace, in the Dark Dystopia
Posts: 19,118
Thanks Given: 2,351
Thanked 3,359 Times in 1,878 Posts
.dat files can be either binary or text.
Ref:
Quote:
A DAT file is a generic data file created by a specific application. It may contain data in binary or text format (text-based DAT files can be viewed in a text editor). DAT files are typically accessed only by the application that created them.
Hence, it is more than likely not possible to use dos2unix to convert a .dat file without more information on the file.
Ref:
Quote:
The Dos2unix package includes utilities "dos2unix" and "unix2dos" to convert plain text files in DOS or Mac format to Unix format and vice versa.
In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks.
The way to proceed in this question:
Quote:
Originally Posted by Ovid158
I uploaded a .dat file from sftp to my server and after using dos2unix to convert the file and check my work it says that the file was not transferred correctly and that the content is garbled. Please help
... is to know what application created the .dat file and if the file is text or binary.
As Rudi mentioned, it is more than likely binary data; so dos2unix is not going to help as that utility is for text files.
So, the ball is in Ovid158's court to tell us what exact application created the .dat file in question and if the file is binary or text, as hicksd8 requested.
Hi,
I have a .dat file with contents like the below:
Input file
============SEQ NO-1: COLUMN1==========
9835619
7152815
============SEQ NO-2: COLUMN2 ==========
7615348
7015548
9373086
============SEQ NO-3: COLUMN3===========
9373086
Expected Output: (I just... (1 Reply)
Hi,
I need help to convert the date format in .DAT file in unix.
I want to convert
10@@|SWIFT MT568 Extract@@|Apr 14 2014 5:47:52:563PM@@|Apr 14 2014 4:33:47:663PM@@||##|
into
10@@|SWIFT MT568 Extract@@|04/14/2014/ 5:47:52:563PM@@|04/14/2014 4:33:47:663PM@@||##|
Appreciate... (18 Replies)
Hi,
The source system has created the file in the dat format and put into the linux directory as mentioned below. I want to do foloowing things.
a) Delete the Line started with <CR><LF> in the record
b)Also line
...........................................................<CR><LF>
... (1 Reply)
Hello,
is here anybody who know How I convert the .dat format files to .su format files in SeismicUnix.
Is it possible?
The dat-format files was generated when I run the forel's script, like model1.sh .
Thanks a lot
Vianney (1 Reply)
Hi
I have a test.dat file in UNIX which has a data.I am informatica developer i get data in those files.I need to add 50 spaces to those data in test.dat file.I am new to unix So can any one help how can i do that.
I have some 2088 rows in that test.dat file.
Can anyone help me please its... (11 Replies)
I have a .dat file in unix and it keeps failing file validation on line x. How do I delete a data string from a .dat file in UNIX?
I tried the following:
sed -e 'data string' -e file name
and it telling me unrecognized command (4 Replies)
Hi All,
I have a .dat file named test.dat where I have stored some process IDs.
Now I need to pick a process ID, one by one and then fire kill -9 for each of those. The logic should be:
1. open file <filename.dat>
2. read until last line of file
3. if process ID is found fire kill -9... (5 Replies)
Can Anyone Be Any Assistance To Help A New User Get His Back-up Commands Defined Along With Other Useful Information On Viewing What's On Tapes And Restoring Data From The Tapes. (0 Replies)