I have a large collection of directories full of various files and am
looking to create custom text files for the contents of each
directory. Here is the situation:
The directories are named with a name and number, i.e. Smith1234567.
I am looking to create a text file named with the number portion of
the directory name (1234567.txt). The contents of the text file would
look similar to the following, where the "TIF" files at the end of
each line are the contents of each directory:
0001234567,Policy Archive,ARCHVE,\CUSTOMER\IMAGES\T10020402151414500 001.TIF
0001234567,Policy Archive,ARCHVE,\CUSTOMER\IMAGES\T10020402151414500 002.TIF
0001234567,Policy Archive,ARCHVE,\CUSTOMER\IMAGES\T10020402151414500 003.TIF
0001234567,Policy Archive,ARCHVE,\CUSTOMER\IMAGES\T10020402151414500 004.TIF
0001234567,Policy Archive,ARCHVE,\CUSTOMER\IMAGES\T10020402151414500 005.TIF
So basically, a text file containing 3 leading zeroes followed by the
number portion of the directory name, the text "Policy
Archive,ARCHVE,\CUSTOMER\IMAGES\" followed by the filename; one line
in the text file per file in the directory.
Obviously, my question is if and how it can be done.
Thanks in advance,
Gema 1 3862
Gema Gema <dc*****@hotmail.com> schreef in berichtnieuws
iq****************@newsread3.news.atl.earthlink.ne t...
Hello Gema, I have a large collection of directories full of various files and am looking to create custom text files for the contents of each directory. Here is the situation:
The directories are named with a name and number, i.e. Smith1234567. I am looking to create a text file named with the number portion of the directory name (1234567.txt).
If the numeric portion of that name is fixed, the answer is to use a simple
RIGHT$( {string},LEN( {string} )- {fixed number} ) .
If not, two methods are available :
A) move back from the end until you find a non-numeric char (use MID$( ) for
this), move one stap back (to the last numeric char, and use MID$( ).
B) Move forward untill you find a numeric char, and use MID$( ) . This may
cause troubles if the "name" portion of the directory is something like
"123Smith1234567" or "smith123_1234567"
To append two strings together, use '&' : DirName$=right$( .... ) & ".txt"
The contents of the text file would look similar to the following, where the "TIF" files at the end of each line are the contents of each directory:
[Snip]
So basically, a text file containing 3 leading zeroes followed by the number portion of the directory name, the text "Policy Archive,ARCHVE,\CUSTOMER\IMAGES\" followed by the filename; one line in the text file per file in the directory.
To write the retieved filenames to a file, use the the PRINT statement,
which can also write to a file. See "OPEN .... FOR OUTPUT as ...." for
that.
To retrieve the contents of a directory, use DIR$
Obviously, my question is if and how it can be done.
Hmmm ... I don't think can be done, and have no idea to how to do it :-)
Regards,
Rudy Wieser This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Thomas Philips |
last post by:
In the course of playing around with file input and output, I came
across some behavior that is not quite intuitive. I created a simple
text file, test.txt, which contains only 3 lines, and which I...
|
by: Jim |
last post by:
I'm a little new to the C# way of doing thisgs... Although
I've done this sort of thing before in VS 6 / MFC...
creatnig controls, ActiveX controls, etc. Creating
controls in MFC is pretty...
|
by: Stelrad Doulton |
last post by:
Hi,
I am having a strange problem on IIS 6.0.
I am trying to create directories under a virtual directory on the fly to
which I will upload files and retrieve these files later. I am having 2...
|
by: F. Michael Miller |
last post by:
I'd like to copy the listing of a directory (& sub directories) to a text
file in vb.net.
I'm looking for teh equivilant of the DOS command dir /s >
TargetFile.txt.
Thanks!
|
by: Eric Lindsay |
last post by:
This may be too far off topic, however I was looking at this page
http://www.hixie.ch/advocacy/xhtml about XHTML problems by Ian Hickson.
It is served as text/plain, according to Firefox...
|
by: Sam777 |
last post by:
I was under the impression that creating the app_offline.htm file at the
root of the webapp would cause all handles to be closed so that the app could
be removed. Unfortunately, this isn't the...
|
by: Light |
last post by:
Re,
I'm having 2 problems with the Telerik trial controls. I'm using the
latest release. I'm using 2005 studio and most of the controls show up
properly in the designer but the RadMenu does...
|
by: techusky |
last post by:
I have a *very* simple script written that displays the directory
listing of the current working directory, but I am having some
difficulty when I try to change folders. Basically, I have my $dir...
|
by: Kelicula |
last post by:
This is NOT a complete OO perl tutorial
However I thought it could be beneficial to explain some of the basic concepts, and allow some users to simplify the software design process.
I have...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: erikbower65 |
last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA:
1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
|
by: kcodez |
last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: DJRhino |
last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer)
If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _
310030356 Or 310030359 Or 310030362 Or...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
| |