Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Sorting list of files per date column Post 302255495 by shivaastrogun on Thursday 6th of November 2008 02:04:12 PM
Old 11-06-2008
help need to sort files

Hi,

When I tried to execute below script to sort datefield (eg: 13Aug07_1900), it is not working

cat amex1025 | sort -t"." -k 9.6,9.7 -k 9.3,9.5 -k 9.1,9.2

our file name is: amex1025

-rwxrwxrwx 1 stuprd stuprd 2604 Nov 4 18:27 SONYELEC00.GI22976.13Aug07_1900.gpg
-rwxrwxrwx 1 stuprd stuprd 154129 Nov 4 18:27 SONYELEC00.GI22976.19Apr07_1733.gpg
-rwxrwxrwx 1 stuprd stuprd 146385 Nov 4 18:27 SONYELEC00.GI22976.26Jun08_1900.gpg
-rwxrwxrwx 1 stuprd stuprd 2605 Nov 4 18:27 SONYELEC00.GI22977.13Aug07_1900.gpg
-rwxrwxrwx 1 stuprd stuprd 95605 Nov 4 18:27 SONYELEC00.GI22977.19Apr07_1733.gpg
-rwxrwxrwx 1 stuprd stuprd 147299 Nov 4 18:27 SONYELEC00.GI22977.26Jun08_1900.gpg

please advice5

Thanks
S2
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sorting Files by date and moving files in date order

I need to build a k shell script that will sort files in a directory where files appear like this "XXXX_2008021213.DAT. I need to sort by date in the filename and then move files by individual date to a working folder. concatenate the files in the working folder then start a process once... (2 Replies)
Discussion started by: rebel64
2 Replies

2. UNIX for Dummies Questions & Answers

Get the list of files for a given date

Hi, the command "ls -l" gives the list of files of a directory with details such as date and size. Is there a way to restrict this list to see only files created on a given date? Suppose I want to list only the files created today, what is the command to type? Thanks (3 Replies)
Discussion started by: vanagreg
3 Replies

3. UNIX for Advanced & Expert Users

Help with sorting files according to modification date

Hi, I was very surprised to not be able to find an answer to this question despite my best efforts in Google and elsewhere. Maybe it's a good thing as it forced me to finally become a member in this great forum that i use frequently. Ok my question: I want to be able to sort files inside a... (3 Replies)
Discussion started by: stavros
3 Replies

4. Shell Programming and Scripting

[SOLVED] Sorting into new files based on column

Hi, I have the following file, I need to sort it based on a column and write to different output files based on this column request_guid iso_country_cd address_data response_time 32895901-d17f-414c-ac93-3e7e0f5ec240 AND BaseName:CATALUNYA; HouseNumber:1; ISOCountryCode:AND;... (1 Reply)
Discussion started by: ramky79
1 Replies

5. Shell Programming and Scripting

[Solved] Sorting a column based on another column

hello, I have a file as follows: F0100010 A C F0100040 A G BTA-28763-no-rs 77.2692 F0100020 A G F0100030 A T BTA-29334-no-rs 11.4989 F0100030 A T F0100020 A G BTA-29515-no-rs 127.006 F0100040 A G F0100010 A C BTA-29644-no-rs 7.29827 F0100050 A... (9 Replies)
Discussion started by: Homa
9 Replies

6. Shell Programming and Scripting

Finding files and sorting by date (find | awk)

I am wanting to search a directory tree and return files that are older than a specified datetime. So far straight forward with find, now I want to sort in date order and format the output. So far I have this, but is not working and there is a problem with "." in the file and/or path names. ... (2 Replies)
Discussion started by: larry2311
2 Replies

7. UNIX for Dummies Questions & Answers

Creating a two column list of date pairs form a single column list

Hi all, looking for some help here. I'm what you'd call a dirty programmer. my shell scripts might be ugly, but they (usually) function... Say I have a single column text file with a list of dates (yyyymmdd) that represent the elevation of a point on that date (I work with land subsidence, so... (2 Replies)
Discussion started by: jbrandt1979
2 Replies

8. Shell Programming and Scripting

How to list files that are not first two files date & last file date for every month-year?

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)
Discussion started by: Makarand Dodmis
2 Replies

9. UNIX for Dummies Questions & Answers

Date column validation in files

HI, i have to do some file validations on which i am receving daily.could any one please let me know how we can able to do validations on below scenarios 1) On Date column Ex If i am receving date in format of YYYYMMDD---- 20141118 --- here i have to check the date value 20141142 if the... (7 Replies)
Discussion started by: bhaskar v
7 Replies

10. Shell Programming and Scripting

List the files after sorting based on file content

Hi, I have two pipe separated files as below: head -3 file1.txt "HD"|"Nov 11 2016 4:08AM"|"0000000018" "DT"|"240350264"|"56432" "DT"|"240350264"|"56432" head -3 file2.txt "HD"|"Nov 15 2016 2:18AM"|"0000000019" "DT"|"240350264"|"56432" "DT"|"240350264"|"56432" I want to list the... (6 Replies)
Discussion started by: Prasannag87
6 Replies
JETRING(7)							 jetring commands							JETRING(7)

NAME
jetring - maintenance of gpg keyrings using changesets OVERVIEW
jetring is a collection of tools that allow for gpg keyrings to be maintained using changesets. It was developed with the Debian keyring in mind, and aims to solve the problem that a gpg keyring is a binary blob that's hard for multiple people to collaboratively edit. With jetring, changesets can be submitted, reviewed to see exactly what they will do, applied, and used to build a keyring. The origin of every change made to the keyring is available for auditing, and gpg signatures can be used to further secure things. OPERATION
A jetring directory is used as the "source" that a keyring is built from. To convert an existing gpg keyring to such a directory, use the jetring-explode(1) command. Each change to the gpg keyring is stored in a separate changeset file in the directory. Changesets can reflect any set of changes to the keyring. Changesets can also include arbitrary metadata. The jetring-gen(1) command can be used to compare two keyrings and generate a changeset from one to the other. Changesets are never removed or modified, only new ones added, using the jetring-accept(1) command. There's an ordering of the changesets. This ordering is stored in an index file. The index file is only appended to, to add new changesets. Changesets can be fully examined to see what change they make before applying them. The jetring-review(1) and jetring-diff(1) commands can be used for such review. To create a new keyring, or incrementally update an existing keyring, changesets are applied in order using the jetring-build(1) command. GPG SIGNATURES
The index file can optionally be gpg signed (the signature will be stored in index.gpg); if JETRING_SIGN is set to point to a gpg keyring, then jetring commands that operate on the jetring directory will always check that the index file is signed with one of the keys from that keyring. Commands that modify the index file will update its signature. CHANGESET FORMAT
A changeset file consists of one or more stanzas, separated by blank lines. The stanzas are in RFC-822-like format. Each stanza must have an action field, which specifies which action to take on the keyring, and a data field, typically a multi-line field, which contains the data to feed to the action. Supported actions are: import The data field should be an ascii-armored gpg key block, that is fed into gpg --import. edit-key keyid gpg --edit-key is run on the specified key id. The data field is a script, each line in it is passed in to gpg, the same as if gpg were being driven interactively. This can be used to make arbitrary changes to the key. delete-key keyid The given key is deleted. The data is fed into gpg --delete-key, and should be "y", since gpg expects that confirmation to deleting a key. Other fields can be added as desired to hold metadata about the change. Typical additional fields include date, changed-by, and comment. Changesets can be optionally have attached signatures, although such data is not automatically validated and is mostly useful to record who submitted or signed off on a given changeset. AUTHOR
Joey Hess, <joey@kitenet.net>. JETRING(7)
All times are GMT -4. The time now is 05:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy