01-08-2009
I got the solution for above asked question
i have used the following code
$d="uncompress -c test.tar.Z |tar xfq - folder1/obj/one.txt";
system $d;
open(VERSION,"folder1/obj/one.txt") || print ("\nMissing 'INFO' file \n");
while (<VERSION>) {
chop;
$newlVersion=$_;
print "$newlVersion";
}
close VERSION;
system "rm -rf folder1";
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Dear experts
I have received a tar file containing several files with full path. Now I need to restore it in another system but when I want to extract files by using
tar -xvf tarfile
it wants to create all files with full paths again in new system in which I don't have enough previleges.
How... (4 Replies)
Discussion started by: Reza Nazarian
4 Replies
2. UNIX Desktop Questions & Answers
Can I extract files from an archive file (tar), where the filename includes the full directory path, to a different directory?
For example the archive files may have a filename of
/SrcFiles/XXX/filename.dat
and I want to extract it to /SrcFiles/YYY/filename.dat. Since the archive file... (1 Reply)
Discussion started by: nmalencia
1 Replies
3. UNIX for Dummies Questions & Answers
Can I extract files from an archive file (tar), where the filename includes the full directory path, to a different directory?
For example the archive files may have a filename of
/SrcFiles/XXX/filename.dat
and I want to extract it to /SrcFiles/YYY/filename.dat. Since the archive file was... (1 Reply)
Discussion started by: nmalencia
1 Replies
4. Solaris
Is there an option in tar which deletes the .tar file as soon as it is successfully extracted. (5 Replies)
Discussion started by: vickylife
5 Replies
5. Shell Programming and Scripting
Hello, I'm working on a script to extract the contents of a file (in general, plain txt file with numbers, symbols, and letters) and output it into a .txt file. but it is kind of all over the place. It needs to not include duplicates and the content has to be readable. I jumped all over the place... (7 Replies)
Discussion started by: l20N1N
7 Replies
6. UNIX for Advanced & Expert Users
Is anyone out there? I'm trying to run a script i wrote that extracts multiple .tar files in succession by pasting it into standard input. It does extract them all but I cant get it to stop looping and when I hit enter I get a tar command error like its still looking for files to extract.
ie;
... (2 Replies)
Discussion started by: commoja
2 Replies
7. Shell Programming and Scripting
Hi All,
I have the file in this format
**** Results Data ****
Time or Step
1
2
20
0.000000000e+00 0s 0s 0s
1.024000000e+00 Us 0s 0s
1.100000000e+00 1s 0s 0s
1.100000001e+00 1s 0s 1s
2.024000000e+00 Us Us 1s
2.024000001e+00 ... (7 Replies)
Discussion started by: diehard
7 Replies
8. Shell Programming and Scripting
Hello All,
Hope you are doing well!!!!!
I have a small code in the below format in xml file:
<UML:ModelElement.taggedValue>
<UML:TaggedValue tag="documentation" value="This sequence

HLD_EA_0001X
HLD_DOORS_002X"/>
<UML:TaggedValue tag="documentation" value="This... (11 Replies)
Discussion started by: suvendu4urs
11 Replies
9. OS X (Apple)
Hi
I have a few hundred files with extension .tar.Z. These files were archived (tar) and compressed (Z) on a UNIX system. I need to unzip them but not extract them. In other words they need to go to .tar extension. I would like to do this on my MAC or on a windows pc. I do not have a UNIX... (3 Replies)
Discussion started by: kalbano
3 Replies
10. UNIX for Beginners Questions & Answers
hello
i wish to write the result of these below conditions in a file:
1. in a specific folder, i have many tar.gz files.
2. each tar.gz file contains ".dat" file in sub folders.
3. i wish to get the full path of these .dat files, if i find in it a specific word ("ERROR24").
4. all this... (6 Replies)
Discussion started by: jimmyjames9
6 Replies
LEARN ABOUT CENTOS
tar_append_regfile
tar_append_file(3) C Library Calls tar_append_file(3)
NAME
tar_append_file, tar_append_eof, tar_append_regfile - append data to tar archives
SYNOPSIS
#include <libtar.h>
int tar_append_file(TAR *t, char *realname, char *savename);
int tar_append_regfile(TAR *t, char *realname);
int tar_append_eof(TAR *t);
VERSION
This man page documents version 1.2 of libtar.
DESCRIPTION
The tar_append_file() function creates a tar file header block describing the file named by the realname argument, but with the encoded
filename of savename. It then sets the current header associated with the TAR handle t to the newly created header block, and writes this
block to the tar archive associated with t. If the file named by realname is a regular file (and is not encoded as a hard link),
tar_append_file() will call tar_append_regfile() to append the contents of the file.
The tar_append_regfile() function appends the contents of a regular file to the tar archive associated with t. Since this function is
called by tar_append_file(), it should only be necessary for applications that construct and write the tar file header on their own.
The tar_append_eof() function writes an EOF marker (two blocks of all zeros) to the tar file associated with t.
RETURN VALUES
On successful completion, these functions will return 0. On failure, they will return -1 and set errno to an appropriate value.
ERRORS
The tar_append_*() functions will fail if:
EINVAL Less than T_BLOCKSIZE bytes were written to the tar archive.
EINVAL Less than T_BLOCKSIZE bytes were read from the realname file.
They may also fail if any of the following functions fail: lstat(), malloc(), open(), read(), th_write(), or the write function for the
file type associated with the TAR handle t.
SEE ALSO
read(2), open(2), lstat(2), th_write(3)
University of Illinois Jan 2001 tar_append_file(3)