10-10-2007
filtering list results
I created a large file list using:
find . -type f -mtime +540 > test2.txt
..which searched recursively down the directory tree searching for any file older than 540 days.
I would like to filter the results removing the directory name and the "/" character, resulting in only a list of the filenames, i.e.:
directoryName/filename
changed to,
filename
I think using sed or awk would work, but not entirely sure how to proceed.
Thanks!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi
I need to search for matching strings in a database and I want to print out all files that matches in "detail", which means that I want the output to contain datum of last saving. I only get the grep function tp print the actual file names which is not enough since the database is to large... (14 Replies)
Discussion started by: slire
14 Replies
2. Shell Programming and Scripting
Can anybody help me with writing a script for the data that I want to use from one file based on the data from another file. I have file1 in this form;
(the first field represents a well name and the second field represents the depth of interest)
FILE1
--------
DATA_35_0 ... (2 Replies)
Discussion started by: digipak
2 Replies
3. Shell Programming and Scripting
I have asked this question here before and got the answer too. Unfortunately I used only one record as an example and the script works fine for one record but not for more than one record.
Can anybody help me with writing a script for the data that I want to use from one file based on the... (13 Replies)
Discussion started by: digipak
13 Replies
4. UNIX for Dummies Questions & Answers
I received this question for homework:
We have to write our program into a .sh file, with "#!/bin/bash" as the first line. And we have the list of access logs in a file, looking like this (it's nearly 10,000 lines long):
65.214.44.112 - - "GET /~user0/cgg/msg08400.html HTTP/1.0" 304 -... (1 Reply)
Discussion started by: Andrew9191
1 Replies
5. Shell Programming and Scripting
Hi all
When I run the system command "rpm -qa |grep xmpp" it lists many files like
xmpp-3.2.10.20111024-3
xmpp-3.2.10.201110_asd
xmpp-3.2.10.201
and I want to uninstall all the rpms by using rpm -e. How can I do this???
NOTE:
The number of rpms will vary... (3 Replies)
Discussion started by: Ananthdoss
3 Replies
6. Shell Programming and Scripting
Hello ,
When using vim, can ctag and cscope support recording search results and displaying the history results ? Once I jump to one tag, I can use :tnext to jump to next tag, but how can I display the preview search result? (0 Replies)
Discussion started by: 915086731
0 Replies
7. Shell Programming and Scripting
Hi experts,
I have a file image.csv as below:
COMPUTERNAME,23/07/2013,22/07/2013,21/07/2013,20/07/2013,19/07/2013,18/07/2013,17/07/2013
AED03852180,3,3,3,3,3,3,3
AED03852181,3,3,3,3,3,3,1
AED09020382,3,0,3,0,3,3,3
AED09020383,1,3,3,3,2,1,3
AED09020386,3,3,0,3,3,0,3 ... (4 Replies)
Discussion started by: zaq1xsw2
4 Replies
8. Shell Programming and Scripting
I'm looking for some suggestions on a command line utility I am making. I would like to use 'find' to locate some files and index the results so the user can choose the correct results from the list and push that input into an open command. A simple example below:
... (2 Replies)
Discussion started by: sudo
2 Replies
9. Shell Programming and Scripting
Hi All ,
New to the Bash / Shell programming world and looking for some help
I have two files
1: Contains a list of names :
eg
STEVE
BOB
CRAIG
2: Contains information with those included names but also others that are not in the list (1 Reply)
Discussion started by: Lonerg550
1 Replies
10. Shell Programming and Scripting
Good morning all,
This is the file name in question OD_Orders_2019-02-19.csv
I am trying to create a bash script to read into files with yesterdays date on the file name while retaining the rest of the files name. I would like for $y to equal, the name of the file with a formula output with... (2 Replies)
Discussion started by: Ibrahim A
2 Replies
LEARN ABOUT CENTOS
icupkg
ICUPKG(8) ICU 50.1.2 Manual ICUPKG(8)
NAME
icupkg - extract or modify an ICU .dat archive
SYNOPSIS
icupkg [ -h, -?, --help ] [ -tl, --type l | -tb, --type b | -te, --type e ] [ -c, --copyright | -C, --comment comment ] [ -a, --add list ]
[ -r, --remove list ] [ -x, --extract list ] [ -l, --list ] [ -s, --sourcedir source ] [ -d, --destdir destination ] [ -w, --writepkg ] [
-m, --matchmode mode ] infilename [ outfilename ]
DESCRIPTION
icupkg reads the input ICU .dat package file, modify it according to the options, swap it to the desired platform properties (charset &
endianness), and optionally write the resulting ICU .dat package to the output file. Items are removed, then added, then extracted and
listed. An ICU .dat package is written if items are removed or added, or if the input and output filenames differ, or if the -w,
--writepkg option is set.
If the input filename is "new" then an empty package is created. If the output filename is missing, then it is automatically generated
from the input filename. If the input filename ends with an l, b, or e matching its platform properties, then the output filename will con-
tain the letter from the -t, --type option.
This tool can also be used to just swap a single ICU data file, replacing the former icuswap tool. For this mode, provide the infilename
(and optional outfilename) for a non-package ICU data file. Allowed options include -t, -w, -s and -d The filenames can be absolute, or
relative to the source/dest dir paths. Other options are not allowed in this mode.
OPTIONS
-h, -?, --help
Print help about usage and exit.
-tl, --type l
Output for little-endian/ASCII charset family. The output type defaults to the input type.
-tb, --type b
Output for big-endian/ASCII charset family. The output type defaults to the input type.
-te, --type e
Output for big-endian/EBCDIC charset family. The output type defaults to the input type.
-c,--copyright
Include the ICU copyright notice in the resulting data.
-C, --comment comment
Include the specified comment in the resulting data instead of the ICU copyright notice.
-a, --add list
Add items from the list to the package. The list can be a single filename with a .txt file extension containing a list of item file-
names, or an ICU .dat package filename.
-r, --remove list
Remove items from the list from the package. The list can be a single filename with a .txt file extension containing a list of item
filenames, or an ICU .dat package filename.
-x, --extract list
Extract items from the list from the package. The list can be a single filename with a .txt file extension containing a list of item
filenames, or an ICU .dat package filename.
-m, --matchmode mode
Set the matching mode for item names with wildcards.
-s, --sourcedir source
Set the source directory to source. The default source directory is the current directory.
-d, --destdir destination
Set the destination directory to destination. The default destination directory is the current directory.
-l, --list
List the package items to stdout (after modifying the package).
LIST FILE SYNTAX
Items are listed on one or more lines and separated by whitespace (space+tab). Comments begin with # and are ignored. Empty lines are
ignored. Lines where the first non-whitespace character is one of "%&'()*+,-./:;<=>?_ are also ignored to reserve for future syntax.
Items for removal or extraction may contain a single * wildcard character. The * matches zero or more characters. If -m, --matchmode
noslash is set, then the * character does not match the / character.
Items must be listed relative to the package, and the --sourcedir or the --destdir path will be prepended. The paths are only prepended to
item filenames while adding or extracting items, not to ICU .dat package or list filenames.
Paths may contain / instead of the platform's file separator character and are converted as appropriate.
AUTHORS
Markus Scherer
George Rhoten
VERSION
1.0
COPYRIGHT
Copyright (C) 2006 IBM, Inc. and others.
SEE ALSO
pkgdata(1) genrb(1)
ICU MANPAGE
18 August 2006 ICUPKG(8)