Sponsored Content
Full Discussion: How to view .dat file?
Operating Systems Linux Red Hat How to view .dat file? Post 302492008 by Rupaa on Saturday 29th of January 2011 04:45:18 AM
Old 01-29-2011
1. ls -l hr_ts_127aws.dat
-rw-r--r-- 1 root root 1901952 Jan 29 10:13 hr_ts_127aws.dat

2. strings hr_ts_127aws.dat | head -10
Aff&Aff
ff^A
Aff
Aff~Aff
ff~A
LA33
Aff^Aff
A33KA33
A33 B
B33 B33

Since its a big file i have given the first 10 lines alone.

3. wc -l hr_ts_127aws.dat
2963 hr_ts_127aws.dat

4. uname -a
Linux paru 2.6.18-128.el5xen #1 SMP Wed Jan 21 11:55:02 EST 2009 i686 i686 i386 GNU/Linux

---------- Post updated at 04:40 AM ---------- Previous update was at 04:31 AM ----------

Even od -c does not work.

# od -c hr_ts_127aws.dat | head -10
0000000 315 314 314 A 315 314 314 A 315 314 310 A 3 3 317 A
0000020 232 231 I A 232 231 205 A 232 231 211 A 3 3 257 A
0000040 315 314 220 A 315 314 254 A \0 \0 244 A \0 300 y 304
0000060 232 231 I A 315 314 224 A \0 \0 220 A f f & A
0000100 f f 232 A 232 231 211 A 232 231 265 A 232 231 321 A
0000120 3 3 343 A f f 266 A f f 342 A f f 342 A
0000140 f f 332 A 232 231 351 A 315 314 300 A \0 \0 \b A
0000160 f f 316 A f f 322 A 232 231 315 A f f 326 A
0000200 232 231 325 A 315 314 314 A 232 231 325 A 315 314 334 A
0000220 315 314 350 A 3 3 333 A 3 3 343 A 232 231 201 A

---------- Post updated at 04:45 AM ---------- Previous update was at 04:40 AM ----------

hi,

FYI

[root@paru Desktop]# ls -l hr_rrate_127aws.dat
-rw-r--r-- 1 root root 1901952 Jan 29 14:51 hr_rrate_127aws.dat
[root@paru Desktop]# strings hr_rrate_127aws.dat
[root@paru Desktop]# wc -l hr_rrate_127aws.dat
0 hr_rrate_127aws.dat
[root@paru Desktop]# uname -a
Linux paru 2.6.18-128.el5xen #1 SMP Wed Jan 21 11:55:02 EST 2009 i686 i686 i386 GNU/Linux
[root@paru Desktop]#
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to attach an excel file/ dat file thru unix mails

Hi. I want to attach a .xls or .dat file while sending mail thru unix. I have come across diff attachments sending options, but allthose embeds the content in the mail. I want the attachement to be send as such. Please help me out. regards Diwakar (1 Reply)
Discussion started by: diwakar82
1 Replies

2. Shell Programming and Scripting

Performance issue in UNIX while generating .dat file from large text file

Hello Gurus, We are facing some performance issue in UNIX. If someone had faced such kind of issue in past please provide your suggestions on this . Problem Definition: /Few of load processes of our Finance Application are facing issue in UNIX when they uses a shell script having below... (19 Replies)
Discussion started by: KRAMA
19 Replies

3. Red Hat

How to view all files on DAT tape

I'm using tar and so far so good, but how can I view ALL files without having to fast forward and rewind the tape? Let's say I append 100 files onto the tape. Having to fast forward 100 times until I find the file I want is kinda tedious. (3 Replies)
Discussion started by: sdotsen
3 Replies

4. UNIX for Advanced & Expert Users

Search in .dat file

How to perform search for a particular text in .dat file in UNIX (2 Replies)
Discussion started by: Deeptanshu
2 Replies

5. UNIX for Dummies Questions & Answers

ID incorrect field values in dat file and output to new file

Hi All I have a .dat file, the values are seperated by ". I wish to identify all field values in field 14 that are not '01-APR-2013' band then copy those records to a new file. Can anyone suggest the UNIX command required. Thanks in advance Andy (2 Replies)
Discussion started by: aurum1313
2 Replies

6. Shell Programming and Scripting

FASTEN count line of dat file and compare with the CTRL file

Hi All, I thinking on how to accelerate the speed on calculate the dat file against the number of records CTRL file. There are about 300 to 400 folder directories that contains both DAT and CTL files. DAT contain all the flat files records CTL is the reference check file for the... (3 Replies)
Discussion started by: ckwan
3 Replies

7. Shell Programming and Scripting

Execution of loop :Splitting a single file into multiple .dat file

hdr=$(cut -c1 $path$file|head -1)#extract header”H” trl=$(cut -c|path$file|tail -1)#extract trailer “T” SplitFile=$(cut -c 50-250 $path 1$newfile |sed'$/ *$//' head -1')# to trim white space and extract table name If; then # start loop if it is a header While read I #read file Do... (4 Replies)
Discussion started by: SwagatikaP1
4 Replies

8. Answers to Frequently Asked Questions

How to split a dat file based on another file ni UNIX?

i have two files , one is var.txt and another res.dat file var.txt contains informaton like below date,request,sales,item 20171015,1,123456,216 20171015,1,123456,217 20171015,2,345678,214 20171015,3,456789,218 and res.dat contains is a one huge file contains information like... (1 Reply)
Discussion started by: pogo
1 Replies

9. UNIX for Beginners Questions & Answers

Convert EBCDIC(.DAT) FILE into ASCII FILE

Hi Team, I am having 100 EBCDIC files (i.e. DAT extension) and need to convert them into ASCII File by unix shell script. I tried with DD Command but its not providing output as expected. Sample Text: ------------------ âäàáãåçñ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Expected Output:... (2 Replies)
Discussion started by: JSM
2 Replies

10. Shell Programming and Scripting

How to use 'ls' command to list files like *.dat, not *.*.dat?

How to use 'ls' command to list files like *.dat, not *.*.dat (5 Replies)
Discussion started by: pmcginni777
5 Replies
IO::AtomicFile(3)					User Contributed Perl Documentation					 IO::AtomicFile(3)

NAME
IO::AtomicFile - write a file which is updated atomically SYNOPSIS
use IO::AtomicFile; ### Write a temp file, and have it install itself when closed: my $FH = IO::AtomicFile->open("bar.dat", "w"); print $FH "Hello! "; $FH->close || die "couldn't install atomic file: $!"; ### Write a temp file, but delete it before it gets installed: my $FH = IO::AtomicFile->open("bar.dat", "w"); print $FH "Hello! "; $FH->delete; ### Write a temp file, but neither install it nor delete it: my $FH = IO::AtomicFile->open("bar.dat", "w"); print $FH "Hello! "; $FH->detach; DESCRIPTION
This module is intended for people who need to update files reliably in the face of unexpected program termination. For example, you generally don't want to be halfway in the middle of writing /etc/passwd and have your program terminate! Even the act of writing a single scalar to a filehandle is not atomic. But this module gives you true atomic updates, via rename(). When you open a file /foo/bar.dat via this module, you are actually opening a temporary file /foo/bar.dat..TMP, and writing your output there. The act of closing this file (either explicitly via close(), or implicitly via the destruction of the object) will cause rename() to be called... therefore, from the point of view of the outside world, the file's contents are updated in a single time quantum. To ensure that problems do not go undetected, the "close" method done by the destructor will raise a fatal exception if the rename() fails. The explicit close() just returns undef. You can also decide at any point to trash the file you've been building. AUTHOR
Primary Maintainer David F. Skoll (dfs@roaringpenguin.com). Original Author Eryq (eryq@zeegee.com). President, ZeeGee Software Inc (http://www.zeegee.com). REVISION
$Revision: 1.2 $ perl v5.18.2 2005-02-10 IO::AtomicFile(3)
All times are GMT -4. The time now is 09:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy