I would like to copy the first and third char on each line of a file and place them in the 14h and 17th char positions. The file name is listed first and is 6 char's and the dir name is second and also same char size on each line.
The file has thousands of lines.
Initial file contents:
Final contents needed:
Last edited by joeyg; 01-10-2017 at 10:44 AM..
Reason: Added codetags
hello
I'm trying to batch copy files from one location to another. My script get's the output of a find command (i.e. find /disk3/jpm/seq -type f | xargs copy2boss)
The script works fine, except when filenames contains whitespace, backslashes and so on. Any hints? Is there another more accurate... (2 Replies)
Hello, Member or professional
need help how to count characters by line of file
Example of the file is here
cdr20080817164322811681txt
cdr20080817164322811txt
cdr20080817164322811683txt
cdr20080817164322811684txt
I want to count the characters by line of file . The output that I... (4 Replies)
Hi Friends
I have a file
like
sample1.txt
------------
10998909.txt
10898990.txt
1898772222.txt
8980000000000.txt
I need to take first 3 characters of each line in a file and i need to print it '
like loop
109
108
189
898 (7 Replies)
Dear community,
I'm quite a newbie with scripting, I have this problem:
I have a file with many lines and I want to copy the lines from 1 to N to file.1, from N+1 to 2N to file.2, and so on up to the end of the file
I have tried with something like this (N=43 in this example):
awk '{for... (2 Replies)
Dear Members,
For example i have a file which contains 10 lines as below:
123testing
gopjp
jg9459\
834789rh
fh456
47rf
497rvg
409748\
08ntr
i need the first three characters of the first line of the file.
if i use
cut -c 1-3 < sample.txtits displaying the 1st three... (8 Replies)
Hi,
I have a file with about 25 colums separated with '~', but few of the lines have extra tabs ('^') and new line characters ('$'). Is there a way I can delete those characters if they are anywhere before the 25th column in a line?
example:
CLUB000650;12345678;0087788667;NOOP MEMBER ... (4 Replies)
I am having a file(1234.txt) downloaded from windows server (in Ascii format).However when i ftp this file to Unix server and try to work with it..i am unable to do anything.When i try to open the file using vi editor the file opens in the following format ...
@
@
@
@
@
@
@
@... (4 Replies)
Hi All,
I need to copy a specific line from a file to another file.
lets suppose the line number 13 of a file
when I am writing the line number explicitly.. its working fine
sed -n '13p' afile > anotherfile
but, when inside a script, i am getting the line number value inside a variable... (4 Replies)
hi to all,
i am writing a simple file program in C which has to take a string of length n as input and match that input string with first n character of the line in file. if it does not match it has to compare with first n characters of next line. i am finding it difficult to know how exactly to... (2 Replies)
Discussion started by: ntrikoti
2 Replies
LEARN ABOUT DEBIAN
io::async::file
IO::Async::File(3pm) User Contributed Perl Documentation IO::Async::File(3pm)NAME
"IO::Async::File" - watch a file for changes
SYNOPSIS
use IO::Async::File;
use IO::Async::Loop;
my $loop = IO::Async::Loop->new;
my $file = IO::Async::File->new(
filename => "config.ini",
on_mtime_changed => sub {
my ( $self ) = @_;
print STDERR "Config file has changed
";
reload_config( $self->handle );
}
);
$loop->add( $file );
$loop->run;
DESCRIPTION
This subclass of IO::Async::Notifier watches an open filehandle or named filesystem entity for changes in its "stat()" fields. It invokes
various events when the values of these fields change. It is most often used to watch a file for size changes; for this task see also
IO::Async::FileStream.
While called "File", it is not required that the watched filehandle be a regular file. It is possible to watch anything that stat(2) may be
called on, such as directories or other filesystem entities.
EVENTS
The following events are invoked, either using subclass methods or CODE references in parameters.
on_dev_changed $new_dev, $old_dev
on_ino_changed $new_ino, $old_ino
...
on_ctime_changed $new_ctime, $old_ctime
Invoked when each of the individual "stat()" fields have changed. All the "stat()" fields are supported apart from "blocks" and "blksize".
Each is passed the new and old values of the field.
on_devino_changed $new_stat, $old_stat
Invoked when either of the "dev" or "ino" fields have changed. It is passed two File::stat instances containing the complete old and new
"stat()" fields. This can be used to observe when a named file is renamed; it will not be observed to happen on opened filehandles.
on_stat_changed $new_stat, $old_stat
Invoked when any of the "stat()" fields have changed. It is passed two File::stat instances containing the old and new "stat()" fields.
PARAMETERS
The following named parameters may be passed to "new" or "configure".
handle => IO
The opened filehandle to watch for "stat()" changes if "filename" is not supplied.
filename => STRING
Optional. If supplied, watches the named file rather than the filehandle given in "handle". The file will be opened for reading and
then watched for renames. If the file is renamed, the new filename is opened and tracked similarly after closing the previous file.
interval => NUM
Optional. The interval in seconds to poll the filehandle using stat(2) looking for size changes. A default of 2 seconds will be
applied if not defined.
METHODS
$handle = $file->handle
Returns the filehandle currently associated with the instance; either the one passed to the "handle" parameter, or opened from the
"filename" parameter.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-10-24 IO::Async::File(3pm)