I want to compress a file with name ASCOnnect200_V5.0.0.0_09_Dec_11.zip. I it possible with winrar/rar?
The file name ASCOnnect200_V5.0.0.0_ will be always constant and the date part will be in the format dd-mmm-yy.
In cmd:
rar.exe a -ag+YYYYMMDD arc {FolderName}
The answer is in this forum :)
Related
I have a csv file score.csv with at path /NAS/DQ with 2 columns Scorename,filename.
scorename,filename
ABC,cust.txt
XYZ,bank.txt
These filescust.txt and bank.txt are placed at /NAS/files_path. There will be unique instance of each file placed at this path everyday.
I want to append the file timestamp from /NAS/files_path to /NAS/DQ csv file.
So the timestamp should be updated everytime to the csv file at /NAS/DQ location.
I am new to unix and currently looking for ways to do it.
Any help is appreciated!!
Sed will be a good candidate for this:
sed -ri '2,$s/(^.*$)/\1 '$(date)'/' filename
Substitute the existing line for the existing line plus a space and the date. The format of the date can be amended as required with +%.. We don't want to format the first line, so run the amendments from lines 2 to the last line ($)
I am using an FTP server which, while listing the files using e.g. ls command, returns the last modification date in following format:
05/06/12
Is there a way to know what date format the remote server is using?
There is no definition about date format in the listings, it is not even defined that the listings should include the date at all. So you can only guess if you need to parse the listing. For a reliable and defined way to get the modification time of a file use the MDTM command. Unfortunately you need to send this for each file which could make everything slower.
Problem: Rename the file to “Result_[timestamp].csv”, where timestamp has format yyyymmddhhmmss
The file is on D:/path/mytest.csv
Thanks!
Look at the MoveFile method of the FileSystemObject or the Name property of the File object. For example:
CreateObject("Scripting.FileSystemObject").MoveFile strOldFileName, strNewFileName
Or:
CreateObject("Scripting.FileSystemObject").GetFile(strOldFileName).Name = strNewFileName
As for formatting the date, see this post from earlier today.
Good luck.
Ok, so there are a plethora of examples and apps using ExifTool to convert EXIF data to .jpg names. But what if you want to go the other way around? I have a number of files that use ODBC date, but contain no meta EXIF date. How can I - with what app or EXIFTool commandline - update the EXIF_DATE from a filename?
2012-02-24_1330073217.jpg
I found a Windows app
EXIFDate by filenamepattern that does this, but I'm a mac user. :/
This command will do what you want:
exiftool "-alldates<filename" DIR
where DIR is one or more directory and/or file names.
I have a program that reads in a file and does some parsing to it. The file is generated by another program every night. Due to the ICD the date is part of the file name.
The file name changes every night due to the date change so I am not sure how to have my program change the fileIn name to accommodate this.
If the current fileIn is:
in20120103out.dat
Tomorrow's fileIn is:
in20120104out.dat
filename = Time.now.strftime("in%Y%m%dout.dat")
or
require 'date'
filename = Date.today.strftime("in%Y%m%dout.dat")
strftime means string format for time. The %-parameters are placeholder for Year (Y), month (m), day (d). (There are more placeholders, e.g. year without century...)
You can use the strftime() method to generate the date portion of the filename:
t = Time.now
filename = "in#{t.strftime('%Y%m%d')}out.dat"
And then use the filename variable to open the file as normal.