Sponsored Content
Top Forums Programming How to open hidden file and converted into .dat format? Post 302984283 by avi1991nash on Monday 24th of October 2016 05:13:36 AM
Old 10-24-2016
How to open hidden file and converted into .dat format?

Here i am having ".tmideg0"hidden file .
I have made programm but it doesnot work
Code:
#!/usr/bin/perl




$runDir = $ENV{"REGR_RUN_DIR"};
@files = (<*.tmideg0> <*.tmideg1>);

foreach $FILE (@files)
{
open (IN, $FILE) || die "Couldn't open $FILE for reading";
open (OUT, ">$runDir/$FILE.dat") || die "Couldn't open $FILE for reading";

while(<IN>) {
    print OUT $_;
}
}
close(IN);
close(OUT);

---------- Post updated at 02:43 PM ---------- Previous update was at 11:09 AM ----------

here i am having code
in which it convert all ".txt" file to ".txt.dat" file but i want ".dat file" how to do it.

Code:
#!/usr/bin/perl

$runDir = $ENV{"REGR_RUN_DIR"};
@files = (<*.txt>);

foreach $FILE (@files)
{
open (IN, $FILE) || die "Couldn't open $FILE for reading";

open (OUT, ">$runDir/$FILE.dat") || die "Couldn't open $FILE for reading";

while(<IN>) {
    print OUT $_;
}
}
close(IN);
close(OUT);

Moderator's Comments:
Mod Comment edit by bakunin: since Don Cragun has edited in the missing CODE-tags for you, you have appended your original post, AGAIN NOT USING CODE-TAGS! How often, do you think. we need to ask you to use them until this bears fruit?

Last edited by bakunin; 10-24-2016 at 08:21 AM.. Reason: Add CODE tags.
 

9 More Discussions You Might Find Interesting

1. Linux

How to open a .DAT video file in LINUX

:confused: Hai guys!!!! I am using Mandrake Linux 10.1 with Intel P4 system.. I don't know how to open .DAT video file in LINUX. Please help me! (1 Reply)
Discussion started by: mahi3699
1 Replies

2. Solaris

/etc/format.dat file currupt

What we have to do when the /etc/format.dat file is corrupted? (3 Replies)
Discussion started by: lbreddy
3 Replies

3. UNIX for Dummies Questions & Answers

List all directories hidden or not hidden

I want to list all directories hidden or not hidden. ls -ld */ => shows only not hidden directories so i guess the answer would be to add the a option to show all files ls -lad */ => not working :confused: ls -la | grep "^d" => works But I would like to know why I can't use ls -lad... (4 Replies)
Discussion started by: servus
4 Replies

4. UNIX for Dummies Questions & Answers

How to Open a data format file?

Hi, Am having a file. I checked that file format by the following command file filename Output is filename: data So the file is data format file Am trying to view that file so i have used some commands like cat,more so on but it showing the contents like compressed form(full of Symbols). How... (4 Replies)
Discussion started by: Adhi
4 Replies

5. Shell Programming and Scripting

Tar to decompress and to convert file to .dat format

tar -tvf abc.tar.gz gives me the file name abc.Is it possible to rename the file to abc.dat while decompressing using tar ? Thanks. (2 Replies)
Discussion started by: vedanta
2 Replies

6. Shell Programming and Scripting

Date format change in UNIX .dat file

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)
Discussion started by: karthikengox
18 Replies

7. Programming

Python Results Converted To C Struct Header File

I created python code that produce output in the form of: moses-red-sea=1.00.03 genesis-snake=2.03 deliverance=5.0.010 I need to take this output and create a "C" header file and have it look like this: struct { char *name; char *fixed_version; } filename_versions... (7 Replies)
Discussion started by: metallica1973
7 Replies

8. 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

9. Shell Programming and Scripting

Rsync - how to copy hidden folder or hidden files when using full path

Hello. I use this command : rsync -av --include=".*" --dry-run "$A_FULL_PATH_S" "$A_FULL_PATH_D"The data comes from the output of a find command. And no full source directories are in use, only some files. Source example... (2 Replies)
Discussion started by: jcdole
2 Replies
pymcaroitool(1) 					 PyMca X-Ray Fluorescence Toolkit					   pymcaroitool(1)

NAME
pymcaroitool - PyMca region-of-interest imaging X application SYNOPSIS
pymcaroitool [OPTIONS]... [FILE(S)] DESCRIPTION
Start the graphical user interface of the PyMca X-Ray Fluorescence Toolkit region-of-interest imaging tool. This tool is best suited for handling datasets that can be represented by three-dimensional arrays. Typical cases are stacks of images (first dimension is image number) or 2D maps of 1D spectra (last dimension is spectrum channel number). It allows to display maps of particular regions of the spectra or spectra of a particular region of the map. A system of plugins allow to extend the capabilities of this tool. Plugins for multivariate analysis are already built in. If FILE is given, it will be opened in the program provided its format is supported. EXAMPLES
pymcaroitool Start the program with a file browser to select the input files. pymcaroitool file_0001.edf Tries to open the file named file_0001.edf and all indexed files of the form file_????.edf where ???? is a number. pymcaroitool --imagestack=1 file_0001.edf Tries to open the file named file_0001.edf and all indexed files of the form file_????.edf where ???? is a number as a set of images. pymcaroitool uncompressed_tiff_file_0001.tif Tries to open a series of uncompressed TIFF files as an image stack. pymcaroitool --begin=100 --end=200 --filepattern=file_%05d.edf Start the program loading the single indexed files from file_00100.edf to file_00200.edf pymcaroitool --begin=10,100 --end=20,200 --filepattern=row%d_col%03d.dat Load the double indexed files from row10_col100.dat, row10_col101.dat, ... to row20_col00199.dat, row20_col00200.dat CAVEATS
If files f_000.xxx and f_001.xxx are present in the same directory, the program will always try to load both of them unless a cumbersome way using a file pattern is used. SEE ALSO
HDF5, h5py ESRF
March 2012 pymcaroitool(1)
All times are GMT -4. The time now is 08:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy