473,382 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Using xp date variable to name a file

2
I need to know how to name an output file in XP so that the file name looks like the following:

02/14/2007.qic

Can I use the %date% variable and how would I do it?
Feb 12 '07 #1
8 7087
bartonc
6,596 Expert 4TB
I need to know how to name an output file in XP so that the file name looks like the following:

02/14/2007.qic

Can I use the %date% variable and how would I do it?
Are you write DOS batch files or using some other programming language. Once we have that info, we will know which forum this actually belongs in.
Thanks for joining TSDN!
Feb 12 '07 #2
Geezer
2
Are you write DOS batch files or using some other programming language. Once we have that info, we will know which forum this actually belongs in.
Thanks for joining TSDN!

Am familiar with DOS, and windows XP.
Suggest a direction and I will do the research.

I wish to name an output file from a backup program using the current date as follows:

xx/xx/xxxx.qic
Feb 12 '07 #3
r035198x
13,262 8TB
Am familiar with DOS, and windows XP.
Suggest a direction and I will do the research.

I wish to name an output file from a backup program using the current date as follows:

xx/xx/xxxx.qic
Can you tell us more about the back-up program?
Feb 12 '07 #4
ghostdog74
511 Expert 256MB
I need to know how to name an output file in XP so that the file name looks like the following:

02/14/2007.qic

Can I use the %date% variable and how would I do it?
first you have to know what your output of 'date /t' is like.
On my machine its Tue 02/13/2007
then using for loop
Expand|Select|Wrap|Line Numbers
  1. @echo off
  2. for /F "tokens=1,2 delims= " %%i in ('date /t') do (
  3.     echo %%j
  4.     echo test > %%j.qic
  5. )
  6. )
  7.  
Feb 13 '07 #5
maxamis4
295 Expert 100+
Make it easy on your self, why not just name 02-13-2007
Feb 13 '07 #6
Cyberdyne
627 Expert 512MB
can't use / character file name, sorry. use - or . instead, good luck!
Feb 14 '07 #7
ghostdog74
511 Expert 256MB
yes,"/" can't be used..so it should be something like this
Expand|Select|Wrap|Line Numbers
  1. @echo off
  2. for /F "tokens=1,2 delims= " %%i in ('date /t') do (
  3.      echo %%j
  4.      for /F "tokens=1,2,3 delims=/" %%a in ("%%j") do echo test>%%a-%%b-%%c.qic
  5. )
  6.  
Feb 14 '07 #8
trigon
1
In addition to this, if you want (with DOS command) to copy file 1.csv to file 2.csv where file 2.csv should have a DATE name (only month and year) what command I should use.

Thank you in advance
May 7 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: jim.kelly | last post by:
Hi all, I'm having trouble with the following line of code in my php script: $result = mysql_query('LOAD DATA LOCAL INFILE "NYSE_".$today.".txt" INTO TABLE main FIELDS TERMINATED BY "," LINES...
6
by: Jocknerd | last post by:
I'm a Python newbie and I'm having trouble with Regular Expressions when reading in a text file. Here is a sample layout of the input file: 09/04/2004 Virginia 44 Temple ...
3
by: Sandros | last post by:
Background: I'm collecting usability statistics for a group of applications. Each count has the following attributes: date, application, major heading, minor heading, count. My intent is to pull...
0
by: David | last post by:
Please help. I am able to display a folder structure and files but I can't figure out how to add subfolders and maintain the same look. I am a little embarrased but I thought someone out there...
2
by: Mark | last post by:
I have an Access 2000 database that pulls a file in everyday via the TransferText method. The file is named "psjrnl 25-Sep-2003.txt" (the 25-Sep-2003 will change and have the current days date). My...
2
by: Keith | last post by:
Good Afternoon, New to .Net. I am trying to pass date/time values to a MS Access query depending on what value is selected from a dropdown list box (January, February, etc). I have declared...
1
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as...
0
by: =?Utf-8?B?QnJ5YW4=?= | last post by:
Hello group. I've migrated from Win 2003 server to Win 2008 server. I've been banging my head agaist a wall for several days now trying to figure this out. I have the following script that will...
1
by: swethak | last post by:
hi, i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.