Script to move files with one occurence of a string to one directory, and other files to another directory?
I could use a script for the bash shell to look through a group of files (s=
elected from one directory by a wildcard expression) and move any of those =
files with exactly one occurrence of the string Path: to a different direct=
ory, usually a subdirectory of the first directory. The rest of the files =
selected by the wildcard expression are move to a third directory, also usu=
ally a subdirectory of the first directory. I'm currently doing this manua=
lly, but with grep commands to count the number of occurrences.
NOT homework - I'm retired. Actually using Cygwin (an em...move files from one Windows computer to another over internet
Does Windows have a program that will allow you to move files from one
Windows computer to another over the internet? I exchange video files with
people over Yahoo messenger but that's really slow. Is there a better way
to do a direct transfer? You'd think Windows would be able to do this. I
have a fast cable internet connection at home and my friends have cable or
> Does Windows have a program that will allow you to move files from one
> Windows computer to another over the internet? I exchange video files
> with people ...files, directories, files, directories
I've been trying to make a decision and it's driving me crazy.
Is a directory a file or is a directory NOT a file but a node?
Should I have
public interface IFile
public interface IDirectory
public interface INode
public interface IFile
public interface IDirectory
Method A is nice cause IFile becomes the base "Node" type and you can use
names like "IFileName" which sounds nice compared to "INodeName" and fits
with the "FileSystem" moniker. A has the disadvantage that IDirectory has a
GetContent() method which isn't bad but can be considered a bit weird. It
probably wouldn't be too hard to make users think of everything as a file.
Method B is nice cause IDirectory doesn't have GetContent() -- that honour
belongs only to IFile. B is at a disadvantage when it comes to naming:
everything becomes a "Node". INodeName sounds rude compared to IFileName.
This method feels more "pure" cause you're specialising features completely.
Do you reckon I can get away with Method A? It doesn't seem as pure unless
you spend a long time convincing yourself that (for all intents and
purposes) a file *is* a node (it's just got a different name) and a
directory *is* a file.
A penny for anyone's thought...process files one by one in the directory
I have 4 files named ab12.txt, cd45.txt, ug3h.txt, kf8l.txt in a directory.
I have a function like [X,Y] = myfunction (filename, collection).
Collection = 2 always. But the filenames changes. I have to use this function using above filenames one by one.
How can I just create the variable (filename = 'ab12'), run the function. again create the variable (filename = 'cd45') and run the function and so on until the last 4th file.
"yogesh kumkar" <firstname.lastname@example.org> wrote in message
news:email@example.com....how do I read all the files in a given directory one by one?
I want to read one file in a directory, then the next file in the same
directory, then the next file, until the last file in the directory. I
don't know how many files are in the directory. Can anybody teach me
how to accomplish this task?
Do I have to use a system call dir and store the file names in another
file and then access all the files? Or is there a shortcut to do this?
On Wed, 18 Jun 2008 09:10:38 -0700 (PDT), william <firstname.lastname@example.org> wrote:
>I want to read one file in a directory, then the next file in the same
>directory, then the next fi...copying & moving files/folders in r2009a's current directory window extremely slow
does anyone else have this problem?
moving/copying anything larger than about 500kb takes forever in the ML builtin directory window. if a folder with about 100 small .csv files is moved then 9/10 of the time it crashes ML.
I'm on XP pro SP3, and didn't have this problem with r2007b.
...Undefined error #612
I got this message when i did a nonlinear regression. I am using SPSS
Undefined error #612 - Cannot open text file "C:\Program
Files\SPSS\en\windows\spss.err": No such file or directory=AC
Predicted values are missing, or case weights are missing or not
positive for all cases.
This command is not executed.
What is wrong with the SPSS? I have no problem at all when i use
- I have not seen anyone respond to this one -
Here is a comment, even though it is not very useful.
On 22 Mar 2005 18:56:27 -0800, "run" <email@example.com> wrote:
> I got this message when i did a nonlinear regression. I am using SPSS
> Undefined error #612 - Cannot open text file "C:\Program
> Files\SPSS\en\windows\spss.err": No such file or directory�
1) That's a funny character at the end of 'directory', which
reads as "=AC" or else as a special character.
2) That text file message seems to point to a message-file
that should be there at installation; so it *seems* to signify
that the installation went wrong, or disk contents have been
altered since the time of installation.
Combining those two things with my long experience at
pondering error messages -- I wonder whether SPSS could
be totally screwed up at this stage, so that the next line
about "Predicted values ... weights" may have little to do
with anythi...Move the file pointer to the beginning of the file (text mode in Windows)?
I have a text file opened using the function fopen(filename,'r').
Assume that after some file reading, the file pointer is at position
X. Now I want to move it to the beginning of the file.
I see function fsee() can help to move the file pointer to a position
in the file. Unfortunately according to my book, on MS DOS, it works
only with binary files. (in UNIX it works for both binary and text
My program is written in Windows OS so I guess this function does not
Do you know in Windows, what function I can use to move the file
pointer to a specifi...File/Directory move
Is there a way to guarantee a successful file/directory move operation
with any type of prior checking and reservation?
...How many files in a windows directory
I have an application that uses DBF to store the path and file name and
saves the graphic files in a directory. My question is
how many files could be saved in a windows directory?
Is it better to save also the file in a blob field??
> I have an application that uses DBF to store the path and file name and
> saves the graphic files in a directory. My question is
> how many files could be saved in a windows directory?
> Is it better to save also the file in a blob field??
I agree with storing the path and file name, and placing the ima...Working with files and directories on Windows
Problem 1: I need to access a set of files all with same name and all
in subdirectories of the directory I run the executable in.
Problem 2. I need to edit a file but want to create a .bak first.
Are these possible for a C beginner or do they require the sacrifice of
of a young virgin and buying books on the Win32 API.
> Problem 1: I need to access a set of files all with same name and all
> in subdirectories of the directory I run the executable in.
see the description of the "system()" function. You can call it as:
system( "dir /B dirname\*.dat >...createing directories and moving files into it
I have an undetermined list of directories.
I am trying to loop through them all and in each one I want to make a
directory called 'images'. when i do this, I want o move all the imagges
in that folder into it.
so i have a tree like this:
I would like to create
- img21234235...File Scaning the Windows Directory
I wrote a program to Scan my hard drive and list the Files /
Directories that are on it. For some reason, if I change my input to
C:\Windows it will not allow me to scan it. Is there anyway around
...How many files in one directory
can someone please tell me if there is a limit of files that I can
create in one subdirectory? I dont want to keep all of these files
open. I have an x86 target with compact flash and noticed that file
creating runs slow when I reach 1000 files.
I came across the same problem a little while back.
There's no limit to the number of files in sub-dirs (afaik) apart from
the FS size limit. There is a limit for the root dir.
But the DOS FS is very inefficient when the number of entries in a
directory becomes large.
Even when the files are deleted, access time to the di...File and directory permissions in windows
I have some problems to get the the permissions on windows. I use a simple
code that run perfectly in UNIX but give me wrong information on Windows. I
found this code searching by google:
st = os.stat('fichero.txt')
mode = st[stat.ST_MODE]
if mode & stat.S_IREAD: # same as stat.S_IRUSR
if mode & stat.S_IWRITE: # same as stat.S_IWUSR
if mode & stat.S_IEXEC: # same as stat.S_IXUSR
This code allway...Too many files in one directory (again)
I've heard the lecture(s) before, so please spare us all a repeat,
but I recently had occasion to (try to) unpack a "tar" archive which
wants to create about 190000 files in one directory. On an HP PA-RISC
workstation c3700 running HP-UX 11.11 it took about 35 minutes. On an
HP IA64 workstation zx2000 running VMS V8.3-1H1, it's about eight hours
into the VMSTAR job, it hasn't created half the files yet, and it does
not seem to be getting faster as it goes.
The file names all look like "020989f4d6c2f32768d0535c1815344d.zip",
"11509dd158a696797eca570...Moving directories of files to dos
I want to move some directories that are used for java development from
a Alpha VMS system to a DOS/Windows system. What is a good
way to do that? I there a good cross-platform zip/unzip program?
I want to move the .java files and various ascii data files read by
the dos programs. I will have to convert a few .com files to .bat.
tadamsmar <firstname.lastname@example.org> wrote:
> I want to move some directories that are used for java development
> from a Alpha VMS system to a DOS/Windows system. What is a good
> way to do that? I there a good cross-platform zip/unzip program?
The ...can we access more than one xml file from one single xls file.
i am a beginer and wanted to know if i can access more than one xml
file from one single xls file.
if yes,then how will i be able to do it?
> hi everyone,
> i am a beginer and wanted to know if i can access more than one xml
> file from one single xls file.
> if yes,then how will i be able to do it?
<xsl:variable name="document1" value="document('./doc.xml')"/>
and then you can acces it like this:
...move 7500 files to various directories
Let me say up front that this is my first software writing experience.
As of a week ago, I had no knowledge of perl or any other language.
Over the past weekend, I've done a ton of searching and reading. I
believe my problem is simple, but the solution isn't quite as easy for
me to write.
I have 7500 pictures in a directory that need to move to roughly 40
different directories. I have a text file that lists the names of
7500 files (digital pictures) and the corresponding directory they
need to be moved to. All the files are currently in a single
directory, c:\photos....OBJRexx for Windows: How to rename or move a file
How to rename a file using Object Rexx for Windows (version 2.1) ? Don't
like to open the file and read every record.
Is it possible to move the file at the same time ?
from c:\temp\fromdir\filename1.txt --> c:\temp\todir\filename2.txt
Take a look at the File System Object (FSO) - most examples you will
find will be in VBScript, but that is easily translated to Object
Rexx. I'm a bit "tied up" right now, but if you don't find what you
need, post back and I'll put together an example.
On Fri, 12 Sep 2003 12:58:58 +0200, "Ande...Moving a file to an archive directory after import
I am currently working on the following piece of code for MS Access which
searches for a particular file name and then uses the Access Transfer Text
command to load to a table in my Access DB. I'm not a programmer so I'm just
winging this and what I'd really like to do is be able to move files that
are already processed to another directory so they can't be loaded again.
Any help that people can provide is greatly appreciated.
Private Sub Command0_Click()
Dim i As Integer
Dim sArchiveDir As String
sArchiveDir = "C:\scg\American Powernet\target\done"
Set fs = Application.FileSearch
.Lookin = "C:\temp\data\target"
.FileName = "INVOICE_*.CSV"
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
DoCmd.TransferText acImportDelim, "Bill Invoice", "Bill Invoice",
..FoundFiles(i), False, ""
MsgBox "There were no files found."
-----BEGIN PGP SIGNED MESSAGE-----
After the TransferText command, use the FileCopy and Kill commands.
See the Access VBA help files for their usage.
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
-----END PGP SIGNATURE-----
> I am currently working on the following piece of code for MS Ac...What is the fastest way to move files between directories?
I have around 1.9 million files that I need to move between directories.
The directories live on different physical drives on the same machine.
My current solution is very inadequate and over the last 4 days or so,
I'm only down to 1.2 million files left to transfer. Any suggestions
(besides find data reduction methods that don't generate so may files :-))?
(Note: The current inadequate method was to create a shell script that
would just "mv file new-dir/file" ...i.e.,
mv f0 data500/f0
mv f1 data500/f1
....line after line...)
Michael A. Koerber wrote:
> I have around 1.9 million files that I need to move between directories.
> The directories live on different physical drives on the same machine.
> My current solution is very inadequate and over the last 4 days or so,
> I'm only down to 1.2 million files left to transfer. Any suggestions
> (besides find data reduction methods that don't generate so may files :-))?
> (Note: The current inadequate method was to create a shell script that
> would just "mv file new-dir/file" ...i.e.,
> mv f0 data500/f0
> mv f1 data500/f1
> ...line after line...)
I don't understand why your having problems you should be able to move
all the data in one go quite simply e.g.
#move all data to folder data500
mv * data500/
#move all 2 digit files that start with lower-case letters and end in
d...keep only one latest file in a directory
I have bunch of files in a directory. I need to run a script to keep
only one latest file in that directory and delete all other. Could any
one help me with this?
Thank you in advance.
email@example.com (Shashank Agrawal) writes:
> I have bunch of files in a directory. I need to run a script to keep
> only one latest file in that directory and delete all other. Could
> any one help me with this?
How do you define the latest files? If you can pin that down, find(1)
can probably do it for you.
If you don't think too good, don't think too much
- Ted Williams
Shashank Agrawal wrote:
> I have bunch of files in a directory. I need to run a script to keep
> only one latest file in that directory and delete all other. Could any
> one help me with this?
> Thank you in advance.
Depending on what you mean by "latest", this MAY do what you want:
ls -t | tail +2 | xargs rm -f
> firstname.lastname@example.org (Shashank Agrawal) writes:
> > I have bunch of files in a directory. I need to run a script to
> > keep only one latest file in that directory and delete all
> > other. Could any one help me with this?
> How do you define the latest files? If you can pin that down,
> find(1) can probably do it for you.
Oops, I should read my own tagline :-)
Ed's answer is better.
If you don...Pathname: moving files & directories
This came up at work a while ago and our IT dept. said it was
impossible. If we have the following paths:
dir/customer1/lots more files
how can we end up with this:
I can't really experiment at work because the IT folk would probably not
be best please...