My way of seeing things is you know what you dont want : search for them first and create a list with them, then parse the directory excluding the list content
Code:
MONTH=Sep
-rwxr-xr-x 1 vbe bin 110 Sep 3 2003 tutu.sav
-rwxr-x--- 1 vbe bin 17 Sep 4 2003 tata
-rw-rw-r-- 1 vbe system 7696 Sep 30 2013 bdf_today.130930
n12:/home/vbe $ ll -lrt|grep " Sep "|grep -v -f test.0009|more
-rw-rw-rw- 1 vbe bin 21 Sep 9 2003 testread.out
-rw-rw-rw- 1 vbe bin 1940 Sep 9 2003 cutresults
-rwxrw-rw- 1 vbe bin 237 Sep 9 2003 cuttest
-rw-rw-rw- 1 vbe bin 101 Sep 17 2003 newterm
-rwxr-xr-x 1 vbe bin 394 Sep 17 2003 whiletest
-rw-rw-rw- 1 vbe bin 2920 Sep 17 2003 shell_cpt9
-rw-rw-rw- 1 vbe bin 121 Sep 18 2003 sendmail_cf.modif
-rw-rw-rw- 1 vbe bin 626 Sep 18 2003 lvreduce.howto
-rw-rw-rw- 1 vbe bin 1063 Sep 18 2003 gagatest
-rwxr-xr-x 1 vbe bin 80 Sep 26 2003 popu
-rwxr-xr-x 1 vbe bin 718 Sep 30 2003 cpt9test
-rw-rw-rw- 1 vbe bin 17 Sep 30 2003 errorlog
-rw-rw-rw- 1 vbe bin 450 Sep 30 2003 usersname
-rw-rw-rw- 1 vbe bin 128 Sep 14 2004 bufpages.howto
-rw-rw-rw- 1 vbe bin 136 Sep 27 2004 lup.c
-rwxr-xr-x 1 vbe bin 92 Sep 27 2004 sh_test3
-rwxr-xr-x 1 vbe bin 13 Sep 27 2004 sh_test1
-rw-r----- 1 vbe bin 163448 Sep 28 2004 titi.out
-rw-r--r-- 1 vbe bin 125670 Sep 28 2004 JAVAinfo.out
-rw-rw-rw- 1 vbe bin 931 Sep 29 2004 mozilla_bug
-rw-rw-rw- 1 vbe bin 1605 Sep 1 2005 GW_lan_discon.howto
-rw-r--r-- 1 vbe bin 1871 Sep 1 2005 sasperms.logs
-rw-rw-rw- 1 vbe bin 25940 Sep 2 2005 sasproc_log.log
-rwxr-xr-- 1 vbe bin 321 Sep 7 2005 processor.sh
-rw-rw-rw- 1 vbe bin 68 Sep 7 2005 node.dat
-rw-rw-rw- 1 vbe bin 364 Sep 7 2005 node_name_script
-rw-r--r-- 1 vbe bin 136 Sep 12 2005 net_perf_w_glance.howto
Hi,
I am trying to do achieving of files by months.
find /test -name \*.* -mtime +30
will give me the result of all modified files after 30 days.
But lets say i want to list all files that is modified in last months... what is the command to do it?
Thanks! (13 Replies)
hello
i need a way to list files modified in a specific month and move them to a specific directry , i mean somthing like :
find . -modifiedtime "May" -print -exec /usr/bin/mv newdirectory
thank u (1 Reply)
hello
i need a way to list files modified in a specific month and move them to a specific directry , i mean somthing like :
find . -modifiedtime "May" -print -exec /usr/bin/mv newdirectory
thank u (1 Reply)
Hi All,
I want to find the time diffrence between currnt time and "abc.txt" file create time.
I have solve that but if the abc.txt file created last month then is there any process to find the difftent?
Exp:
Create time of abc.txt is "Apr 14 06:48"
and currect date is "May 17 23:47".... (1 Reply)
Hi All,
I am coding for a requirement where I need to read a file & get the values of SUB_DATE. Once the dates are found, i need to move the files based on these dates from one directory to another.
ie, this is how it will be in the file,
SUB_DATE = 20120608,20120607,20120606,20120606... (5 Replies)
Hi All,
I need to find all files other than first two files dates & last file date for month and month/year wise list.
lets say there are following files in directory
Mar 19 2012 c.txt
Mar 19 2012 cc.txt
Mar 21 2012 d.txt
Mar 22 2012 f.txt
Mar 24 2012 h.txt
Mar 25 2012 w.txt
Feb 12... (2 Replies)
Hi All,
I need to find last two files for the month.
lets say there are following files in directory
-rwxr-xr-x 1 user userg 1596 Mar 19 15:43 c.txt
-rwxr-xr-x 1 user userg 1596 Mar 21 15:43 d.txt
-rwxr-xr-x 1 user userg 1596 Mar 22 15:43 f.txt
-rwxr-xr-x 1... (14 Replies)
Hi All,
I find all files for same month and year
lets say there are following files in directory
-rwxr-xr-x 1 user userg 1596 Mar 19 2012 c.txt
-rwxr-xr-x 1 user userg 1596 Mar 21 2012 d.txt
-rwxr-xr-x 1 user userg 1596 Mar 22 2012 f.txt
-rwxr-xr-x 1... (8 Replies)
how to find all files other than first two dates & last date per month and year
Hi All,
lets say there are following files in directory
-rwxr-xr-x 1 user userg 1596 Mar 19 2012 a.txt
-rwxr-xr-x 1 user userg 1596 Mar 19 2012 b.txt
-rwxr-xr-x 1 user userg ... (6 Replies)
Hi All,
lets say there are following files in directory
-rwxr-xr-x 1 user userg 1596 Mar 19 2012 a.txt
-rwxr-xr-x 1 user userg 1596 Mar 19 2012 b.txt
-rwxr-xr-x 1 user userg 1596 Mar 22 2012 c.txt
-rwxr-xr-x 1 user userg 1596 Mar 24 2012 d.txt... (16 Replies)
Discussion started by: Makarand Dodmis
16 Replies
LEARN ABOUT DEBIAN
pdl::char
Char(3pm) User Contributed Perl Documentation Char(3pm)NAME
PDL::Char -- PDL subclass which allows reading and writing of fixed-length character strings as byte PDLs
SYNOPSIS
use PDL;
use PDL::Char;
my $pchar = PDL::Char->new( [['abc', 'def', 'ghi'],['jkl', 'mno', 'pqr']] );
$pchar->setstr(1,0,'foo');
print $pchar; # 'string' bound to "", perl stringify function
# Prints:
# [
# ['abc' 'foo' 'ghi']
# ['jkl' 'mno' 'pqr']
# ]
print $pchar->atstr(2,0);
# Prints:
# ghi
DESCRIPTION
This subclass of PDL allows one to manipulate PDLs of 'byte' type as if they were made of fixed length strings, not just numbers.
This type of behavior is useful when you want to work with charactar grids. The indexing is done on a string level and not a character
level for the 'setstr' and 'atstr' commands.
This module is in particular useful for writing NetCDF files that include character data using the PDL::NetCDF module.
FUNCTIONS
new
Function to create a byte PDL from a string, list of strings, list of list of strings, etc.
# create a new PDL::Char from a perl array of strings
$strpdl = PDL::Char->new( ['abc', 'def', 'ghij'] );
# Convert a PDL of type 'byte' to a PDL::Char
$strpdl1 = PDL::Char->new (sequence (byte, 4, 5)+99);
$pdlchar3d = PDL::Char->new([['abc','def','ghi'],['jkl', 'mno', 'pqr']]);
string
Function to print a character PDL (created by 'char') in a pretty format.
$char = PDL::Char->new( [['abc', 'def', 'ghi'], ['jkl', 'mno', 'pqr']] );
print $char; # 'string' bound to "", perl stringify function
# Prints:
# [
# ['abc' 'def' 'ghi']
# ['jkl' 'mno' 'pqr']
# ]
# 'string' is overloaded to the "" operator, so:
# print $char;
# should have the same effect.
setstr
Function to set one string value in a character PDL. The input position is the position of the string, not a character in the string. The
first dimension is assumed to be the length of the string.
The input string will be null-padded if the string is shorter than the first dimension of the PDL. It will be truncated if it is longer.
$char = PDL::Char->new( [['abc', 'def', 'ghi'], ['jkl', 'mno', 'pqr']] );
$char->setstr(0,1, 'foobar');
print $char; # 'string' bound to "", perl stringify function
# Prints:
# [
# ['abc' 'def' 'ghi']
# ['foo' 'mno' 'pqr']
# ]
$char->setstr(2,1, 'f');
print $char; # 'string' bound to "", perl stringify function
# Prints:
# [
# ['abc' 'def' 'ghi']
# ['foo' 'mno' 'f'] -> note that this 'f' is stored "f "
# ]
atstr
Function to fetch one string value from a PDL::Char type PDL, given a position within the PDL. The input position of the string, not a
character in the string. The length of the input string is the implied first dimension.
$char = PDL::Char->new( [['abc', 'def', 'ghi'], ['jkl', 'mno', 'pqr']] );
print $char->atstr(0,1);
# Prints:
# jkl
perl v5.14.2 2011-03-30 Char(3pm)