hello
i have a requirement where i have a direcotry in which i get files in the format
STOCKS.20080114.dat
STOCKS.20080115.dat
STOCKS.20080117.dat
STOCKS.20080118.dat
i need to loop through the directory and sort by create date descending order and i need to process the first file.
... (1 Reply)
Hi,
I need to sort all the files in a directory whilst retaining the originals. So if in the directory I have:
File1
File2
File3
I want to sort these files so that I would have:
File1
File1.sort
File2
File2.sort
File3
File3.sort
where I have added the .sort extension to show... (4 Replies)
Hi all.
I have 2 files like this:
f1
A 10
B 80
C 9
f2
A 11
B 700
C 10
What I want is the concatenation of the two files sorted by name (alphabetically) and size (numerically), so the result should be like this:
F3 (cat f1 f2 sorted)
A 10
A 11
B 80
B 700 (2 Replies)
hi there,
I have a directory which contents I can parse dynamically. I end up with a file list. I then want to display those files sorted by date, oldest files first. I have very very little PERL experience...Would anyone know how to do that ? Thanks in advance. (8 Replies)
I got a long list of file name.
My input:
data_1.txt
data_2.txt
data_3.txt
data_10.txt
data_21.txt
data_12.txt
data_4.txt
My desired output:
data_1.txt
data_2.txt
data_3.txt
data_4.txt
data_10.txt
data_12.txt
data_21.txt
Does anybody got idea how to archive it? (11 Replies)
Hi,
A basic query. In the example file below, I want to sort by column 1 and then by column 2 numerically. I have tried sort -k2n,1 file1 but while this sorts the columns in the correct order, it does not sort column 2 numerically. Any help would be much appreciated. Also, if you have time to... (3 Replies)
Greetings - I'm not necessarily new to bash scripting - I'm probably between beginner and intermediate, but I have something that I just cannot figure out after many attempts to find it. I have a file that is merely a list of many files, with their respective paths, and a branch path (ClearCase)... (5 Replies)
Hey Guys,
I am facing an annoying scenario, fewer times when I execute the sort command, it throws out on error saying that "No Space on available on /var/tmp/<temp file name>. May be it is set to /var/tmp directory. I was wondering, if I cant redirect the temporary file creation to any other... (3 Replies)
Hello all,
I have a list of file names in a text document where each file name consists of 4 letters and 3 numbers (for example MACR119). There are 48 file names in the document (they are not in alphabetical or numerical order). I would like to reorder the list of names so that the 48th name is... (3 Replies)
Discussion started by: MDeBiasse
3 Replies
LEARN ABOUT SUSE
reindexdb
REINDEXDB(1) PostgreSQL Client Applications REINDEXDB(1)NAME
reindexdb - reindex a PostgreSQL database
SYNOPSIS
reindexdb [ connection-option... ] [ --table | -t table ] [ --index | -i index ] [ dbname ]
reindexdb [ connection-option... ] [ --all | -a ]
reindexdb [ connection-option... ] [ --system | -s ] [ dbname ]
DESCRIPTION
reindexdb is a utility for rebuilding indexes in a PostgreSQL database.
reindexdb is a wrapper around the SQL command REINDEX [reindex(7)]. There is no effective difference between reindexing databases via this
utility and via other methods for accessing the server.
OPTIONS
reindexdb accepts the following command-line arguments:
-a
--all Reindex all databases.
[-d] dbname
[--dbname] dbname
Specifies the name of the database to be reindexed. If this is not specified and -a (or --all) is not used, the database name is
read from the environment variable PGDATABASE. If that is not set, the user name specified for the connection is used.
-e
--echo Echo the commands that reindexdb generates and sends to the server.
-i index
--index index
Recreate index only.
-q
--quiet
Do not display progress messages.
-s
--system
Reindex database's system catalogs.
-t table
--table table
Reindex table only.
reindexdb also accepts the following command-line arguments for connection parameters:
-h host
--host host
Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory
for the Unix domain socket.
-p port
--port port
Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.
-U username
--username username
User name to connect as.
-w
--no-password
Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as
a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to
enter a password.
-W
--password
Force reindexdb to prompt for a password before connecting to a database.
This option is never essential, since reindexdb will automatically prompt for a password if the server demands password authentica-
tion. However, reindexdb will waste a connection attempt finding out that the server wants a password. In some cases it is worth
typing -W to avoid the extra connection attempt.
ENVIRONMENT
PGDATABASE
PGHOST
PGPORT
PGUSER Default connection parameters
This utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see in the documentation).
DIAGNOSTICS
In case of difficulty, see REINDEX [reindex(7)] and psql(1) for discussions of potential problems and error messages. The database server
must be running at the targeted host. Also, any default connection settings and environment variables used by the libpq front-end library
will apply.
NOTES
reindexdb might need to connect several times to the PostgreSQL server, asking for a password each time. It is convenient to have a
~/.pgpass file in such cases. See in the documentation for more information.
EXAMPLES
To reindex the database test:
$ reindexdb test
To reindex the table foo and the index bar in a database named abcd:
$ reindexdb --table foo --index bar abcd
SEE ALSO
REINDEX [reindex(7)]
Application 2010-05-14 REINDEXDB(1)