Sponsored Content
Full Discussion: Getting date from file name
Top Forums UNIX for Dummies Questions & Answers Getting date from file name Post 302969584 by jgt on Thursday 24th of March 2016 08:20:14 AM
Old 03-24-2016
or you could simply append
Code:
|cut -d_ -f2 |cut -c1-8

to the end of your current code.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Changing Creation Date to a Prespecified Date of a File In Unix

Dear Expert, Is there a command to do that in Unix? In such a way that we don't need to actually "write" or modified the content. -- monkfan (4 Replies)
Discussion started by: monkfan
4 Replies

2. UNIX for Dummies Questions & Answers

Move A File With Same Date,don't Change The Desitination Dir Date

Assume, I created one file three years back and I like to move the file to some other directory with the old date (Creation date)? Is it possible? Explain? (1 Reply)
Discussion started by: jee.ku2
1 Replies

3. Shell Programming and Scripting

finding the previous day date and creating a file with date

Hi guys, I had a scenario... 1. I had to get the previous days date in yyyymmdd format 2. i had to create a file with Date inthe format yyyymmdd.txt format both are different thanks guys in advance.. (4 Replies)
Discussion started by: apple2685
4 Replies

4. UNIX for Dummies Questions & Answers

Delete a row from a file if one column containing a date is greater than the current system date

Hello gurus, I am hoping someone can help me with the required code/script to make this work. I have the following file with records starting at line 4: NETW~US60~000000000013220694~002~~IT~USD~2.24~20110201~99991231~01~01~20101104~... (4 Replies)
Discussion started by: chumsky
4 Replies

5. Shell Programming and Scripting

ksh compare dates INSIDE a file (ie date A is > date B)

In KSH, I am pasting 2 almost identical files together and each one has a date and time on each line. I need to determine if the first instance of the date/time is greater than the 2nd instance of the date/time. If the first instance is greater, I just need to echo that line. I thought I would... (4 Replies)
Discussion started by: right_coaster
4 Replies

6. Shell Programming and Scripting

finding date numeral from file and check the validity of date format

hi there I have file names in different format as below triss_20111117_fxcb.csv triss_fxcb_20111117.csv xpnl_hypo_reu_miplvdone_11172011.csv xpnl_hypo_reu_miplvdone_11-17-2011.csv xpnl_hypo_reu_miplvdone_20111117.csv xpnl_hypo_reu_miplvdone_20111117xfb.csv... (10 Replies)
Discussion started by: manas_ranjan
10 Replies

7. Shell Programming and Scripting

Searching for unknown date inside the file and replace to new date

Hello, Iam a newbies to Shell scripting. Iam trying to replace the date inside the file to new date. is there anyway that we can just use the pattern to search as "..." I have many files want to replace with the same date, and each file contains different date. Thanks for your help. ... (2 Replies)
Discussion started by: Daro
2 Replies

8. UNIX for Dummies Questions & Answers

How to pick the latest file with date as one among the file name.( not exactly present date.)?

i have files like 1)20131112_abc_01.csv and 2)20131113_abc_01.csv and 3)20131113_abc_02.csv when i try to fetch the file in the next day. it shud pick the third file.. plz help me.. and i use `date +"%Y%m%d"` command to fetch..it fetches the current date... (2 Replies)
Discussion started by: applepie
2 Replies

9. Shell Programming and Scripting

Script to determine Date,TotalFile,total size of file based on date

I have file listed like below -rw-r--r--+ 1 test test 17M Nov 26 14:43 test1.gz -rw-r--r--+ 1 test test 0 Nov 26 14:44 test2.gz -rw-r--r--+ 1 test test 0 Nov 27 10:41 test3.gz -rw-r--r--+ 1 test test 244K Nov 27 10:41 test4.gz -rw-r--r--+ 1 test test 17M Nov 27 10:41 test5.gz I... (5 Replies)
Discussion started by: krish2014
5 Replies

10. UNIX for Beginners Questions & Answers

“sed” replace date in text file with current date

We want to call a parameter file (.txt) where my application read dynamic values when the job is triggered, one of such values are below: abc.txt ------------------ Code: line1 line2 line3 $$EDWS_DATE_INSERT=08-27-2019 line4 $$EDWS_PREV_DATE_INSERT=08-26-2019 I am trying to write a... (3 Replies)
Discussion started by: pradeepp
3 Replies
DOVEADM-SEARCH-QUERY(7) 					      Dovecot						   DOVEADM-SEARCH-QUERY(7)

NAME
doveadm-search-query - Overview of search queries for doveadm mailbox commands DESCRIPTION
Several doveadm(1) commands use a search_query in order to act only on matching messages. This manual page describes all SEARCH KEYS, which can be used in a search_query. Each search_query consists at least of one SEARCH KEY. Most of the SEARCH KEYS require an argument. All SEARCH KEYS are case-insensitive. The shortest valid search_query is ALL. For example: doveadm search ALL Multiple search query expressions will be combined with the AND operator by default. To find all messages that are new and greater than 50 kilobyte, one can use: doveadm search NEW LARGER 50k OR-ed SEARCH KEYS have to be written in parenthesis, when mixing ANDs and ORs. Shells commonly require escaping for parentheses. To find messages that were saved on the "13th of April 2007" AND have the Seen and/or Flagged flag set, one can use for example: doveadm search SAVEDON 2007-04-13 ( SEEN OR FLAGGED ) It's also possible to specify the mailbox, in which should be searched. Use either the keyword mailbox and the name of the mailbox or the keyword mailbox-guid and the mailbox's globally unique identifier in the search_query. To find all messages in the mailbox with the GUID "44f68b13ce97044b837f000035ca9452" use: doveadm search mailbox-guid 44f68b13ce97044b837f000035ca9452 ALL To list all deleted messages in the "Trash" folder use: doveadm search mailbox Trash DELETED SEARCH KEYS
The following search keys from the specification of IMAP version 4 revision 1 (see: RFC 3501, section 6.4.4) are supported: ALL Matches all messages. ANSWERED Matches messages with the IMAP flag Answered set. BCC pattern Matches messages, which contain pattern in the BCC field of the message's IMAP envelope structure. BEFORE date specification Matches messages with an internal date before date specification. BODY pattern Matches messages, which contain pattern in the body part. CC pattern Matches messages, which contain pattern in the CC field of the message's IMAP envelope structure. DELETED Matches messages with the IMAP flag Deleted set. DRAFT Matches messages with the IMAP flag Draft set. FLAGGED Matches messages with the IMAP flag Flagged set. FROM pattern Matches messages, which contain pattern in the FROM field of the message's IMAP envelope structure. HEADER field pattern Matches messages, which either have the named header field, when empty pattern was given. Or messages, where the given header field's value contains the specified pattern. KEYWORD keyword Matches messages with the given IMAP keyword (e.g. $Forwarded) flag set. LARGER size Matches messages that are larger than the specified size. MAILBOX name Matches messages in the mailbox with the specified name. MAILBOX-GUID guid Matches messages in the mailbox with the specified guid. NEW Matches messages, which have the IMAP flag Recent set but not the IMAP flag Seen. NOT search key Inverse matching - matches massages, where the search doesn't match the specified search key or its value. OLD Matches messages, which do not have the IMAP flag Recent set. ON date specification Matches messages whose internal date matches the given date specification. search key OR search key Matches messages where one of the OR-ed search keys matches. Note: IMAP4rev1 uses the syntax: OR search key search key RECENT Matches messages with the IMAP flag Recent set. SEEN Matches messages with the IMAP flag Seen set. SENTBEFORE date specification Matches messages with a Date: header before date specification. SENTON date specification Matches messages with a Date: header matching the given date specification. SENTSINCE date specification Matches messages with a Date: header matching or after the given date specification. SINCE date specification Matches messages whose internal date is within or after the given date specification. SMALLER size Matches messages with a size smaller than the given size. SUBJECT pattern Matches messages, which contain pattern in the SUBJECT field of the message's IMAP envelope structure. TEXT pattern Matches messages, which contain pattern in the message body. TO pattern Matches messages, which contain pattern in the TO field of the message's IMAP envelope structure. UID sequence Matches messages with the given UID(s). A sequence may be a single UID. Can be a sequence range, written as from:to, e.g. 100:125. As comma separated list of UIDs, e.g. 11,50,4. It's also possible to combine multiple sequences, e.g. 1,3,5,7,10:20. UNANSWERED Matches messages, which do not have the IMAP flag Answered set. UNDELETED Matches messages, which do not have the IMAP flag Deleted set. UNDRAFT Matches messages, which do not have the IMAP flag Draft set. UNFLAGGED Matches messages, which do not have the IMAP flag Flagged set. UNKEYWORD keyword Matches messages, which do not have the given IMAP keyword flag set UNSEEN Matches messages, which do not have the IMAP flag Seen set. DOVEADM SEARCH KEYS Additional search keys, provided by doveadm(1). SAVEDBEFORE date specification Matches messages, which were saved before date specification. SAVEDON date specification Matches messages whose save date matches the given date specification. SAVEDSINCE date specification Matches messages with a save date matching or after the given date specification. DATE SPECIFICATION
doveadm(1) supports a few additional date specification formats. They can be used anywhere, where a date specification value is obliga- tory. day-month-year Default IMAP4rev1 date format. day, the day of month: 1-31. month, the abbreviated month name: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov or Dec. year, four digits of year, e.g. 2007. For example the "13th of April 2007" will be represented as 13-Apr-2007. interval Combination of a positive integer number and a time unit. Available time units are: weeks (abbr: w), days (abbr: d), hours (abbr: h), mins (abbr: m) and secs (abbr: s). To match messages from last week, you may specify for example: since 1w, since 1weeks or since 7days. Unix timestamp A 10 digit Unix timestamp, seconds since the 1st of January 1970, 00:00:00 UTC. For example the "13th of April 2007" will be repre- sented as 1176418800. YYYY-MM-DD Extended ISO-8601 calendar date format. For example the "13th of April 2007" will be represented as 2007-04-13. SIZE
doveadm(1) provides also an additional size representation format. The following formats can be used anywhere, where a size value is obligatory. octets The message size in octets, as specified in the IMAP4rev1 specification. size The message size in B (byte), k (kilobyte), M (megabyte), G (gigabyte) or T (terabyte). To match messages, bigger than 1 megabyte, you may specify for example: larger 1M or larger 1024k. SEE ALSO
doveadm(1), doveadm-search(1) Dovecot v2.1 2011-11-24 DOVEADM-SEARCH-QUERY(7)
All times are GMT -4. The time now is 05:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy