Sponsored Content
Full Discussion: Read file name based on date
Contact Us Post Here to Contact Site Administrators and Moderators Read file name based on date Post 302979709 by caba_jones on Thursday 18th of August 2016 06:09:11 AM
Old 08-18-2016
Read file name based on date

Hi,

I have file name as Example
Code:
extract_ces_v3_p044444rlt_20160514045705.txt.pgp
extract_ces_v3_p044444rlt_20160614049705.txt.pgp
extract_ces_v3_p044444rlt_20160714046705.txt.pgp

I have to read file name based on date(i.e) files with same date and copy to another directory in shell script.




Thanks,
Caba.

Last edited by rbatte1; 08-18-2016 at 07:18 AM.. Reason: Added CODE tags for file name list
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read file based on condition

Hi Friends, Can any one help with this: I have a huge file with the format as A SAM 4637 B DEPT1 4758 MILAN A SMITH 46585 B DEPT2 5385 HARRYIS B SAMUL 63547 GEORGE B DANIEL 899 BOISE A FRES 736 74638 I have to read this file and write only the records that starts with "B" only ... (5 Replies)
Discussion started by: sbasetty
5 Replies

2. Shell Programming and Scripting

Read a date value from other file.

My Situation is I have to read a date value from previuosly created file and need to increment the date in the newly created file. I need unix scripting for the above condtion. Thanx in advance. (3 Replies)
Discussion started by: chilli_taste
3 Replies

3. Shell Programming and Scripting

Split the file based on date value

Hi frnds, I have flat file as . Say : output-file1.txt Output-file2.txt (1 Reply)
Discussion started by: Gopal_Engg
1 Replies

4. UNIX for Dummies Questions & Answers

Truncating file based on date

Hi, I need to truncate a file based on date.Suppose i have a log file which is getting updated every date,i need to keep 7 days worth of data(like sysdate-7) and rest i want to truncate it.Can some help me? (5 Replies)
Discussion started by: Param0073
5 Replies

5. Shell Programming and Scripting

creating a file name based on date

I need to automate a weekly process of piping a directory list to a csv file. Normally I do ls -l > files_04182010.csv (04182010 being the date..) Can someome show me how I would script this, so that when the script is ran it grabs the current date and formats it and allows me to use that... (8 Replies)
Discussion started by: jeffs42885
8 Replies

6. Shell Programming and Scripting

Help with ksh-to read ip file & append lines to another file based on pattern match

Hi, I need help with this- input.txt : L B white X Y white A B brown M Y black Read this input file and if 3rd column is "white", then add specific lines to another file insert.txt. If 3rd column is brown, add different set of lines to insert.txt, and so on. For example, the given... (6 Replies)
Discussion started by: prashob123
6 Replies

7. 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

8. HP-UX

HP/UX command to pull file name/date based on date

HI, Can anyone tell me how to pull the date and file name separated by a space using the find command or any other command. I want to look through several directories and based on a date timeframe (find -mtime -7), output the file name (without the path) and the date(in format mmddyyyy) to a... (2 Replies)
Discussion started by: lnemitz
2 Replies

9. Shell Programming and Scripting

To take file based on date passed

Hi Guys, I have certain files in my directory which gets appended with dates something like this T1_aug17.txt T1_Aug17.txt T1_Sep17.txt config.txt T1 T2 my code: curr_date=`date -d "$date" +%Y-%m-%d` path=mydir for file in `cat config.txt` do final_file=$(ls $path/ | grep -i... (12 Replies)
Discussion started by: rohit_shinez
12 Replies

10. UNIX for Beginners Questions & Answers

Read a file and send mail based on grep

Hi All, I am having a job and I need to send email when the job is running. On any other case (success,fail) I don't needed to send email. I check with BMC they told they dont have that in the version I am using. So I created a dependent job and grepped for the status and sent email. My... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
SENDFILE(1)                                                   General Commands Manual                                                  SENDFILE(1)

NAME
sendfile - send file(s) via Internet SYNOPSIS
sendfile [ -stMgduzvolSPiqQV ] [ -c=" comment" ] [ -C=program ] [ -ps=[my_ID] ] [ -pe=[to_user] ] [ -m LIMIT ] file [...] user[@host] sendfile -a="archive" [ -uviqQ ] [ -c=" comment" ] [ -C=program ] [ -ps[=my_ID] ] [ -pe[=to_user] ] file_or_directory [...] recipient DESCRIPTION
sendfile sends files to the specified recipient. On the receiving site there must be a SAFT-server (Simple Asynchronous File Transfer) installed like sendfiled which stores incoming files into the recipients spool-directory. SAFT knows about 4 file types: BINARY Byte-stream file which will not be modified. SOURCE Record oriented program source file. Only EOL will be translated. TEXT Human readable text files. EOL and the character set (like German umlauts) will be translated. MIME Multipurpose Internet Mail Extension file as defined by RFC 2045-2049. Files can be sent compressed or pgp-encrypted and/or pgp-signed. As an extension to SAFT, sendfile is able to send multiple binary files in one archive file. Default mode for sendfile is sending compressed binary files. Compression will be disabled for hosts which are inside your LAN and for files which cannot be compressed. With the helper program sfconf you can easily configure sendfile. ARGUMENTS
You have to specify at least one file name and the recipient's address. An address can be specified as: user a local user or a sendfile alias (see below), e.g.: framstag user@host an user on a remote host, e.g.: framstag@bofh.belwue.de saft://host/user like above, but in URL-syntax, e.g.: saft://bofh.belwue.de/framstag saft://host:port/user like above, but with alternate SAFT-port, e.g.: saft://bofh.belwue.de:4870/framstag OPTIONS
-4, -6 Explicitly force IPv4 or IPv6 connections. By default, the program will try to resolve the name given, and choose the appropriate protocol automatically. If resolving a host name returns both IPv4 and IPv6 addresses, sendfile will try to use the adresses in the order they are returned by the resolver. -s Send in source mode (not needed if sending to a unix host). -t Send in text mode (not needed if sending to a unix host). -M Send MIME file (must be external composed before!). -g Send in guessed mode: sendfile tries to guess the correct mode (source, text or binary). This will not work in every case and not on all platforms! -i Print more transaction information. -v Verbose mode: show SAFT protocol messages. -V Show version information and exit. -u Send uncompressed. -z Send compressed. -a Send files or whole directories as one archive (binary mode only). You have to specify an archive name. -d Delete previous sent file. No wildcards allowed. -o Overwrite already sent file(s) with same name. -P Read file from stdin. You must specify a file name, too. -S Spool file into outgoing queue for later processing. You must run a sendfiled which supports this mode. -l List files in the outgoing spool. -q Quiet mode 1: print no transfer messages. -Q Quiet mode 2: print no transfer, information or warning messages. -c Add a short comment to a single file. -C Force usage of specified compression program (gzip or bzip2). -pc Encrypt file(s) with pgp (IDEA symmetric). -pe Encrypt file(s) with pgp (public key). -ps Add pgp signature(s) to the file(s). -m Limit the maximum thruput (in KB/s). ARGUMENTS
user Recipient user name. Can be an alias, too. See below. file File name to be sent. Only when using the -a="archive" option you may specify any file or directory. EXAMPLES
sendfile -t project.txt chief@bigvax.somewhere.net sendfile -a=jokes -c 'from Gary Larson' *.gif framstag FILES
/etc/sendfile.deny Users which are not allowed to receive files or messages (set by root). /var/spool/sendfile/$USER/config/config Your configuration file. Valid entries are (the | symbol means " or"): bell = on|off add a bell when a file or message arrives. deleting = on|off allow remote users to delete their files after transmission msglog = on|off log incoming messages in /var/spool/sendfile/$USER/msglog notification = none|both|mail [user@host]|message [user@host] send a notification when a file has been arrived via mail or message or none or both mechanism. forward = user@host set a forward address. /var/spool/sendfile/$USER/config/restrictions List of addresses from where you don't want messages or files. The format is: user@host [mfb] m stands for messages, f for files and b for both. Wildcards * and ? are allowed. Examples: gates@microsoft.com b *aol.com m You may also specify the addresses in URL-syntax. /var/spool/sendfile/$USER/config/aliases The sendfile alias file. Format: alias address [sendfile-options] Example: chief grmblfz@bigvax.somewhere.net ccc chaoscomputerclub@saft.ccc.de -pe -ps You may also specify the addresses in URL-syntax. SEE ALSO
sfconf receive(1) sendmsg(1) fetchfile(1) AUTHOR
Ulli Horlacher - framstag@rus.uni-stuttgart.de 3rd Berkeley Distribution SENDFILE(1)
All times are GMT -4. The time now is 07:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy