473,659 Members | 3,162 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

variable file import question

Hi all
I have a VB script to import a specific text file
call(s12.txt).
But the annoyting part is that the filename change all the time.
Today it may be S1205 tomorrow it may S121003. I keep have to rename
it to s12.txt. How do I call file i/o function and assign a variable
to the file name. Yes I do know the code for i/o function.
Nov 13 '05 #1
2 1657
One approach I've sometimes taken is simply to rename (or copy) the file to
the desired location/name.

"cong ngo" <co*****@yahoo. com> wrote in message
news:64******** *************** **@posting.goog le.com...
Hi all
I have a VB script to import a specific text file
call(s12.txt).
But the annoyting part is that the filename change all the time.
Today it may be S1205 tomorrow it may S121003. I keep have to rename
it to s12.txt. How do I call file i/o function and assign a variable
to the file name. Yes I do know the code for i/o function.

Nov 13 '05 #2
cong ngo wrote:
Hi all
I have a VB script to import a specific text file
call(s12.txt).
But the annoyting part is that the filename change all the time.
Today it may be S1205 tomorrow it may S121003. I keep have to rename
it to s12.txt. How do I call file i/o function and assign a variable
to the file name. Yes I do know the code for i/o function.


If you want to point to the file (using the standard Open File
interface) you can check

http://www.mvps.org/access/api/api0001.htm

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2557
by: thomasp | last post by:
In the code below I have a function that tests if a file exists. It takes a variable named strFileName, simple enough. My question is, is there a way to pass it a variable with another name as long as the variable is a string? In different subs the variable of the file name may have a different name. An example would be the subOpenFile listed below. I have two files that I want to test with the function: strFileName and strFileName2. I...
17
2705
by: Eric_Dexter | last post by:
def simplecsdtoorc(filename): file = open(filename,"r") alllines = file.read_until("</CsInstruments>") pattern1 = re.compile("</") orcfilename = filename + "orc" for line in alllines: if not pattern1 print >>orcfilename, line I am pretty sure my code isn't close to what I want. I need to be able
8
8083
by: yinglcs | last post by:
Hi, I have the following code: colorIndex = 0; def test(): print colorIndex; This won't work. But it works if i do this:
2
1997
by: Bruza | last post by:
I am trying to define a class static variable. But the value of the static variable seems to be only defined inside the file that the class is declared. See the code below. When I run "python w.py", I got: 000=======Hello World 001=======Hello World 002=======Not Initialized 003=======Not Initialized 004=======Not Initialized
12
7928
by: Chris Allen | last post by:
Hello fellow pythoneers. I'm stumped on something, and I was hoping maybe someone in here would have an elegant solution to my problem. This is the first time I've played around with packages, so I'm probably misunderstanding something here... Here's what I'd like to do in my package. I want my package to use a configuration file, and what I'd like is for the config file to appear magically in each module so I can just grab values from...
3
1141
by: FooFan | last post by:
Hi all, I'm trying to write a fairly simple program in Java that will allow the user to write to a text file, specifiying the File name and Content. I keep getting the same error though that comes up with 'Variable may not be initialized' I've struggled for ages now but can't find the solution Any help would be greatly appreciated! Sorry about the lack of comments. import java.lang.*; import java.util.*; import java.io.*;
4
2335
by: marc wyburn | last post by:
Hi I'm using SQlite and the CSV module and trying to create a class that converts data from CSV file into a SQLite table. My script curently uses functions for everything and I'm trying to improve my class programming. The problem I'm having is with variable expansion. self.cursor.executemany('INSERT INTO test VALUES (?)', CSVinput) If CSVinput is a tuple with only 1 value, everything is fine. If I
0
1000
by: Alexis Boutillier | last post by:
Hi, I have a strange behaviour of python with pdb and import statement. Here is the example code : file my1.py: import my2 file my2.py: a=5
0
136
by: Timothy Grant | last post by:
On Fri, Aug 29, 2008 at 12:48 AM, Alexis Boutillier <alexis.boutillier@arteris.comwrote: http://docs.python.org/ref/import.html -- Stand Fast, tjg.
0
8337
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8748
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8531
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.