say i have these many file in a directory named exam.
1)/exam/newfolder/link.txt.
2)/exam/newfolder1/
and i create a tar say exam.tar
well the problem is,
when i read the tar file i dont find any metadata about the directories,as you cannot create a tar containig empty directories.
on the... (2 Replies)
awk -F ";" '{if($10>80 && NR>1) print $0 }' txt_file_*
I am using this command to print the lines which has 10th field more then 80 and leaving the first line of the file which is the header.
But this is not working , the first line is is coming as output , please correct me .
thanks (2 Replies)
Good morning! I am creating a program that uses raw sockets in C and need to call the "netpacket/packet.h" header file. However when I compile with gcc i get
I'm running os 10.5.8 with version gcc 4.0.1 and just update xcode last night which didn't seem to help. Any ideas will be greatly... (2 Replies)
Hi,
I am writting a script which will take all the files present in 2 directories. (the 2 directories have the same files with same name but some different content)
i need 2 compare 2 files and then copy the contents of file1 to file2. the contents which are missing in file1 and nothing from... (8 Replies)
I would like to print the output beginning with a header from a seperate file like this:
awk 'BEGIN{FS="_";print ((getline < "header.txt")>0)} { if (! ($0 ~ /EL/ ) print }" input.txtWhat am i doing wrong? (4 Replies)
Hi ,
i will be getting 24 files for one day with a formate like 20131028_01 - 20131028_24 kind of ,i am trying to write a shell script to count the number of files and if the count is not equal to 24 print the missing files names
for A in `seq 0 23`; do ls *20131024_`printf "%02d" $A`*;... (3 Replies)
Hi,
I have two input files; file1 and file2. I compare them based on matched values in 1 column and print selected columns of the second file (file2). I got the result but the header was not printed. i want the header of file2 to be printed together with the result. Then i did below codes:-
... (3 Replies)
Hello,
I have to fish out some specific columns from a file based on the header value. I have the list of columns I need in a different file. I thought I could read in the list of headers I need,
# file with header names of required columns in required order
headers_file=$2
# read contents... (11 Replies)
I've been struggling with this one for quite a while and cannot seem to find a solution for this find/replace scenario. Perhaps I'm getting rusty.
I have a file that contains a number of metrics (exactly 3 fields per line) from a few appliances that are collected in parallel. To identify the... (3 Replies)
Hi All,
i am trying to print required multiple columns dynamically from a fie.
But i am able to print only one column at a time.
i am new to shell script, please help me on this issue.
i am using below script
awk -v COLT=$1 '
NR==1 {
for (i=1; i<=NF; i++) {
... (2 Replies)
Discussion started by: balu1234
2 Replies
LEARN ABOUT DEBIAN
mojo::asset::file
Mojo::Asset::File(3pm) User Contributed Perl Documentation Mojo::Asset::File(3pm)NAME
Mojo::Asset::File - File storage for HTTP 1.1 content
SYNOPSIS
use Mojo::Asset::File;
# Temporary file
my $file = Mojo::Asset::File->new;
$file->add_chunk('foo bar baz');
say 'File contains "bar"' if $file->contains('bar') >= 0;
say $file->slurp;
# Existing file
my $file = Mojo::Asset::File->new(path => '/home/sri/foo.txt');
$file->move_to('/yada.txt');
say $file->slurp;
DESCRIPTION
Mojo::Asset::File is a file storage backend for HTTP 1.1 content.
ATTRIBUTES
Mojo::Asset::File inherits all attributes from Mojo::Asset and implements the following new ones.
"cleanup"
my $cleanup = $file->cleanup;
$file = $file->cleanup(1);
Delete file automatically once it's not used anymore.
"handle"
my $handle = $file->handle;
$file = $file->handle(IO::File->new);
File handle, created on demand.
"path"
my $path = $file->path;
$file = $file->path('/home/sri/foo.txt');
File path used to create "handle", can also be automatically generated if necessary.
"tmpdir"
my $tmpdir = $file->tmpdir;
$file = $file->tmpdir('/tmp');
Temporary directory used to generate "path", defaults to the value of the "MOJO_TMPDIR" environment variable or auto detection.
METHODS
Mojo::Asset::File inherits all methods from Mojo::Asset and implements the following new ones.
"add_chunk"
$file = $file->add_chunk('foo bar baz');
Add chunk of data.
"contains"
my $position = $file->contains('bar');
Check if asset contains a specific string.
"get_chunk"
my $chunk = $file->get_chunk($start);
Get chunk of data starting from a specific position.
"is_file"
my $true = $file->is_file;
True.
"move_to"
$file = $file->move_to('/home/sri/bar.txt');
Move asset data into a specific file and disable "cleanup".
"size"
my $size = $file->size;
Size of asset data in bytes.
"slurp"
my $string = $file->slurp;
Read all asset data at once.
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojo::Asset::File(3pm)