f



directory listing into file

Hi there!

I'm trying to write the result of a "dir /b" command into a file. Just 
like this:

dir/b C:\mydir > mydir.txt

The directory contains files in and german, so some characters like 
�,�,.. are not properly written in the file, although they do by listing 
the directory without saving it into the file (dir/b C:\mydir)

Has any of you any idea how could I solve this problem?

Thanks

Yeray

0
Yeray
3/7/2004 8:36:21 PM
comp.os.msdos.programmer 1324 articles. 0 followers. Post Follow

2 Replies
330 Views

Similar Articles

[PageSpeed] 4

Yeray Garcia wrote:
> 
> Hi there!
> 
> I'm trying to write the result of a "dir /b" command into a file. Just
> like this:
> 
> dir/b C:\mydir > mydir.txt
> 
> The directory contains files in and german, so some characters like
> �,�,.. are not properly written in the file, although they do by listing
> the directory without saving it into the file (dir/b C:\mydir)

Die Zeichen sind im MSDOS Format gespeichert, d.h. "type mydir.txt"
oder �ffnen mit einem DOS Editor "edit mydir.txt" liefert auch die
richtige Darstellung. Damit die Zeichen in einem Windows Programm
richtig dargestellt werden ist folgende Ersetzung zu machen:

      �  �  �  �  �  �  �
DOS  84 8E 94 99 81 9A E1
WIN  E4 C4 F6 D6 FC DC DF

Das kann z.B. mit WORD gemacht werden: Nach �ffnen der Datei "MSDOS-Text"
ausw�hlen und dann als "Nur Text" speichern. Damit beim �ffnen das
Auswahlmen� erscheint unter  Extras -> Optionen -> Allgemein  
"Konvertierung beim �ffnen bst�tigen" ausw�hlen.
0
Herbert
3/7/2004 10:28:50 PM
Yeray Garcia <hab@keine.com> wrote:
>Hi there!
>
>I'm trying to write the result of a "dir /b" command into a file. Just 
>like this:
>
>dir/b C:\mydir > mydir.txt
>
>The directory contains files in and german, so some characters like 
>�,�,.. are not properly written in the file, although they do by listing

>the directory without saving it into the file (dir/b C:\mydir)
>
>Has any of you any idea how could I solve this problem?
>
>Thanks
>
>Yeray

It works if you leave out the /b parameter.



0
Andrew
3/7/2004 10:53:37 PM
Reply:

Similar Artilces:

How to separate directory list and file list?
With >glob.glob("*") or >os.listdir(cwd) I can get a combined file list with directory list, but I just wanna a bare file list, no directory list. How to get it? Tons of thanks in advance! Gonnasi Hi, 2005/10/23, Gonnasi <harddong@21cn.net>: > With > >glob.glob("*") > > or > >os.listdir(cwd) > > I can get a combined file list with directory list, but I just wanna a > bare file list, no directory list. How to get it? don't know if it is the best solution, but it looks nice. :) path =3D "/home/test" files =3D [fn...

files, directories, files, directories
Hi folks, 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 A) public interface IFile { IFileName FileName; IContent GetContent(); } public interface IDirectory extends IFile { } or B) public interface INode { INodeName NodeName; } public interface IFile extends INode { IContent GetContent(); } public interface IDirectory extends INode { } 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...

rename to txt file
I am trying to rename a file in my directory. I can see this file in directory. It has an extention of .dep, when I attempt to rename it, nothing gets renamed. When I output all filenames from the directory this particular file containing .dep is not on the list. I can see it is there, however this script doesn't pull it. Do you know what this might mean? require 'fileutils' require 'find' require 'ftools' require 'enumerator' #locate new .dep file and rename to txt file for later modification Dir.entries("C:/Diff").each do |filename| if File.e...

list of files in directory and all subdirectories > files.csv
I've been given the tedious task of having to do a file inventory on our network drives. What I need to do is to get all of the files in a directory and all it's subdirectories into a CSV containing each file's name, size, path, and last modified date. The CSV would then be parsed into a spreadsheet or database for the boss to peruse and query at his leisure in an effort to find the files we can delete to save space. I'm pretty sure there's a shell script I can write to do this, but I'm at a loss as to how. Any help would be very appreciated. johnhutch@gmail.com w...

listing files in a directory
I am trying to get a list of all files of a certain extension type on disk to do some processing in a loop. The code needs to be portable to UNIX, so I need to use plain C++ functionality. Does anyone know of a way to do this ? Any URLs, code snippets, etc ? Is this even possible ? David Jacques wrote: > > I am trying to get a list of all files of a certain extension type on disk > to do some processing in a loop. The code needs to be portable to UNIX, so > I need to use plain C++ functionality. Does anyone know of a way to do this > ? > Any URLs, code snippets, etc ? Is...

List of files from a directory
Dear All, I wuold like to import in a data structure in my workspace a list with all the filenames in a directory of my hard drive (even only the current directory wuold be fine). Does anybody know which command should I use? Or where I can find functions to interact with directories? Thanks for the help. Regards. Pasquale. "Pasquale Aliberti" <alibertipasquale@gmail.com> wrote in message <gku4q4$eig$1@fred.mathworks.com>... > Dear All, > > I wuold like to import in a data structure in my workspace a list with > all the filenames in a directory of my har...

List of all files in directory
I wonder if there is an easy functional implementation for finding all files in a given directory, i.e. the equivalent of the Unix command: $ find <path> -type f For example: $ find . -type f ../a/1 ../a/2 ../a/3 ../a/a/1 ../a/a/2 ../a/a/3 ../a/b/1 ../a/c/1 ../a/c/2 ../a/c/3 ../b/1 ../b/2 ../b/3 (find-files #p"./") ==> (./a/1 ./a/2 ... ./b/3) Currently I use an imperative version what is sufficient for my application in mind (CDDB database), because it has only one directory level. System is CMUCL on Linux. ;; Is there a functional implementation with arbitrary d...

Listing files in a directory
Hi. I have a problem with one my hp-ux machine. When I am in a directory and I try to get a list of the files in this directory, sometimes I get a list of few files instead of the complete list. I also see few directories. Here is an example: I'm in this directory: /Prestito/KTE I try to get the list of the content of this directory with the command "ll". In the list I have to see 3 directories (Acquisiti,Cancellati,DaAcquisire), but the command shows me only "DaAcquisire". I don't know why. I can't execute the command "cd Acquisiti" because the syste...

How to only get a list of the names of the non-directory files in current directory ('.')?
How to only get a list of the names of the non-directory files in current directory ('.')? (Note excluding its subdirectories ). I need the code : ) On Tue, Nov 6, 2012 at 4:19 PM, iMath <redstone-cold@163.com> wrote: > How to only get a list of the names of the non-directory files in current directory ('.')? > (Note excluding its subdirectories ). > > I need the code : ) Start by getting a list of names of everything in the current directory. Then filter that list by testing each one to see if it's a directory. Tip: The second step can be done with os.path.isdir Put some code together and try it. If you have trouble, post your code, any exception traceback you get, and what you're having difficulty with, and we'll go on from there. Have fun! ChrisA =E5=9C=A8 2012=E5=B9=B411=E6=9C=886=E6=97=A5=E6=98=9F=E6=9C=9F=E4=BA=8CUTC+= 8=E4=B8=8B=E5=8D=881=E6=97=B624=E5=88=8641=E7=A7=92=EF=BC=8CChris Angelico= =E5=86=99=E9=81=93=EF=BC=9A > On Tue, Nov 6, 2012 at 4:19 PM, iMath <redstone-cold@163.com> wrote: >=20 > > How to only get a list of the names of the non-directory files in curre= nt directory ('.')? >=20 > > (Note excluding its subdirectories ). >=20 > > >=20 > > I need the code : ) >=20 >=20 >=20 > Start by getting a list of names of everything in the current directory. >=20 >=20 >=20 > Then filter that li...

TSV files as a list of list of lists?
I am loading a few GPS data files as TSV (tab separated). What I would like to do is make the loading of files a bit more dynamic, so I make a list of the file contents. But since the file contents is a list in itself, I get in trouble when I want to manipulate the data. It just takes too long. First, here is how I do it for one file only: GPS1 = Import["F:\\Documents\\Jobb\\SLU\\xyuvw\\GPS.txt", "TSV"] (* Remove column-headers *) GPS1 = Drop[GPS1, 1] (* Make sure row 1 of column 2 or 3 doesn't contain spaces so \ they can be interpreted as numbers (I use swedish RT90 \ grid which gives coordinates in meters). *) If[Head[GPS1[[1, 2]]] == String, GPS1[[All, 2]] = ToExpression[StringReplace[GPS1[[All, 2]], " " -> ""]]]; If[Head[GPS1[[1, 3]]] == String, GPS1[[All, 3]] = ToExpression[StringReplace[GPS1[[All, 3]], " " -> ""]]]; (* Sort the GPS data (first column is time) *) Sort[GPS1] Now, what I would like to do; make an array of file contents (actually a list): GPS[1] = Import["F:\\Documents\\Jobb\\SLU\\xyuvw\\GPS.txt","TSV"]; Do[GPS[1] = ReplacePart[GPS[1], {i,2} -> \ ToExpression[StringReplace[GPS1[[All, 2]], " " -> ""]]], {i, 1, \ Length[GPS[1]]}]; Sort[GPS[1]] This second part takes a very long time to do, because ReplacePart[] has to work through every line one at a time rather than using [All, x] as I do in...

list files in directory
Hello Which class should i use to receive file names which are in specified directory ? Thanx Michal On Fri, 17 Dec 2004 09:29:21 +0100, vertigo wrote: > Hello > Which class should i use to receive file names which are in specified > directory ? > > Thanx > Michal Look at the following methods within java.io.File public String[] list(); public String[] list(FileNameFilter); public File[] listFiles(); public File[] listFiles(FileFilter); public File[] listFiles(FileNameFilter); HTH, La'ie Techie > Which class should i use to receive file names which are in specified > directory ? Look into java.io.File class. It can represent both file and directory. It's isFile() and isDirectory() methods tells you which one it is. Then its listFiles() method will return an array of File objects, which you can call various methods on to get the name, path, etc. Bookmark the Java API docs (http://java.sun.com/j2se/1.5.0/docs/api/) and refer to it often :) ...

Directory and file listing
Hello, I am trying to write my first ruby script to be used with Sketchup. Basically it is the first part of the script that I am having a problem with. So here is what i am trying to do: 1: person imputs the directory path---ie c://program.../yada/ 2: ruby reads all image files in that directory and stores the file names in a string to be used later on. So I basically what the script to go into a directory and list all of the file names. Then I can use those file names to feed into the rest of my script. any help would be appreciated, thanks, Adam -- Posted via http://www.ruby-foru...

List of directories with a directory
I have a directory with 200 sub directories in it. How do I create a list of the sub directory names? I know how create a list of all the files in a directory: opendir(DIR, $dirname) or die "can't open $dirname: $!"; while (defined($file = readdir(DIR))) { next if($file =~ m/^\./); next if($file eq ""); push (@filenames, $file); } closedir(DIR); but how do I do it for the directories within a directory Al Moodie. On Tue, 29 Jan 2008 19:45:50 -0500, Al Moodie <nospam@nospam.com> wrote: >I have a directory with 200 sub directories in it. How do I create ...

List of lists of lists of lists...
I would like to have a list of lists N times deep, and my solution is (in pseudocode): def deep(x): a=[x] return a mylist=[] for N: mylist=deep(mylist) Is there a more elegant way to do it? The maine idea is: from a list having the numbre of steps along N dimensions, generate a list with an item at each possible point. Example 1: N=2 list=[2,3] result=[[1,2],[1,2],[1,2]] Example 2: N=3 list=[3,1,2] result=[[[1,2,3]],[[1,2,3]]] -- Ángel Gutiérrez Rodríguez - agr@fq.uniovi.es Instituto de Ciencia de los Materiales de Madrid - CSIC SpLine - European Syncrothorn Radiat...

display a list of file in a directory
I post this question on comp.emacs, but I do not get any response. So, I post here again.... I installed xemacs-i586-pc-win32-21.4.13 in my Windows XP successfully. But it could not display a list of files in sub-directories. Such as I type in c:\home_dir <retrun>, it is supposed to display a list of files or directories under c:\home_dir, but it does not. How to trigger the problem? Please shed a light. Thanks..... cljlk@hotmail.com (cljlk) writes: > I post this question on comp.emacs, but I do not get any response. > So, I post here again.... > > > ...

Listing changed files between directories
I have two directories: /home/rose_garden/abs/core and /var/abs/core they both contain directories like this acl/ +-----PKGBUILD atl2/ +-----PKGBUILD etc /var/abs/core is rsynced from ArchLinux repos. and /home/rose_garden/abs/core is my work area. When Arch changes or updates the PKGBUILD file I would like to get a list of changed files so I can rebuild my files based in /home/rose_garden/abs/core Simply rsync between the two directories won't work as I need to make some changes before using the "new/updated" PKGBUILD file. I would also like to include any new files t...

Renaming of files in OS directory
Hi, all, I am writing a program that renames files inside OS directories the user provides. I am at the early stage of writing it and I encountered some problems. Below is my code. There is an error i received when i run this code. The error is, WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect. Hope you guys could help. import os, glob def fileDirectory(): #Asks the user for a file root directory fileroot = raw_input("Please input the file root directory \n\n") print fileroot #Returns a list with all...

problem listing files in a directory
hi. i wrote that code to list the files existed in "c:\" but it doesn't seem to work cuz when i excute it it dosn't list all the exitsed files in "c:\" can someone tell me what's wrong ? thanks. #include<stdio.h> #include<dir.h> #define FILE_NOT_FOUND (-1) int main(int argc,char *argv[]) { _finddata_t finddata; long hfile; hfile=_findfirst("c:\*.*",&finddata); while(_findnext(hfile,&finddata)!= FILE_NOT_FOUND){ printf("%s\n",finddata.name); } _findclose(hfile); getchar(); return 0; } In artic...

listing files in sub directories
I am trying to list all files in all sub-directories and have the code below but this is listing the . directories as well as the directories themselves. I just want the full path filenames and not the individual directories out. Here is what I have #!c:/Perl/bin/Perl.exe @ARGV = qw(.) unless @ARGV; use File::Find; find sub { print $File::Find::name, -d && "/", "\n"}, @ARGV for example if structure is c:\file.txt c:\file2.txt c:\one\teo.txt c:\two\text.bmp the output of the script when run from c:\ would be ../ ../script.pl ../file.txt ../file2.txt ../one/ ../...

Get all files list in a directory
Hi all I am trying to find how to open a directory and getting the list of files which belong to it. In the past I did the same thing with "opendir", but I used UNIX and in the windows platform I can not use the same command. I am looking for a solution for almost a week. Please, please, please help. Thanks Yaron "yaron" <c_yaron@hotmail.com> wrote in message news:6404b44.0310041226.205d5a4d@posting.google.com... > Hi all > > I am trying to find how to open a directory and getting the list of > files which belong to it. In the past I did the same thin...

Getting list of files in a directory
I was wondering if someone could show me how to get all files in a directory. Basically I have a directory of files and on each file I want to do a specfic action on. help what Dave wrote: > > > I was wondering if someone could show me how to get all files in a > directory. Basically I have a directory of files and on each file > I > want to do a specfic action on. On Fri, 13 Apr 2007 12:45:21 -0400, Dave wrote: > I was wondering if someone could show me how to get all files in a > directory. Basically I have a directory of files and on each file I want > to do ...

getting the list of files in a directory
In Windows, I have a folder with about 20 sub-directories in it. Each with a different name. Each sub folder contains up to 50 text files containing the data that I need to read. Is there an easy way to read all the files? On 19 Jun, 14:33, william kossack <wskoss...@comcast.net> wrote: > In Windows, I have a folder with about 20 sub-directories in it. Each > with a different name. Each sub folder contains up to 50 text files > containing the data that I need to read. Is there an easy way to read > all the files? If you allocate the directory you can pick up the me...

sql for db2 list db directory and db2 list node directory
DB2 8.2.3 is there a sql equivalent to get the information provided by db2 list node directory db2 list db directory. thanks. No as this info is not contained in catalog tables. There migh be a proc in V8.2 or V9.1, a search in Google would reveal that. There's also a a command DB2CFEXP that extracts this info. Regards, Pierre. -- Pierre Saint-Jacques SES Consultants Inc. 514-737-4515 <dcruncher4@aim.com> a �crit dans le message de news: 1162911799.123033.210830@h48g2000cwc.googlegroups.com... > DB2 8.2.3 > > is there a sql equivalent to get the information provided by > > db2 list node directory > db2 list db directory. > > thanks. > ...

Obtaining a listing of all files in a DODS directory?
Hi, This question concerns the 'Distributed Oceanographic Data System', which provides a way to subset and download enormous data archives, such as satellite data. The data can be ingested into Matlab using the loaddods.m program. If you have experience with accessing DODS data from Matlab, could you please tell me how I can obtain a listing of all files in a data directory on the web, such as http://data.nodc.noaa.gov/cgi-bin/nph-dods/pathfinder/Version5.0/Daily/? For a directory on your own machine, you can get a listing of the files in it by a = dir('*') ; How can I do...

Web resources about - directory listing into file - comp.os.msdos.programmer

Wikipedia:Quick directory - Wikipedia, the free encyclopedia
This page is a handy directory to various locations of interest in Wikipedia. Only dynamic pages should be listed here, no policy pages etc. ...

Wikipedia:WikiProject Council/Directory - Wikipedia, the free encyclopedia
Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. , a non-profit organization.

Don't call us: Centrelink bosses remove phone numbers and email from directory
Tom was savvy enough to take his complaints straight to Centrelink management.

Don't call us: Centrelink bosses remove phone numbers and email from directory
Tom was savvy enough to take his complaints straight to Centrelink management.

Business Directory Listings: Eight Smart Tips for You to Get Started
If you are considering a business directory listing for your small business, congratulations – you are on the right track. Local SEO, local customers, ...

Atlas Partner Directory Launched
... just for Facebook and Instagram –advertising platform Atlas has one, as well. On that note, Atlas Tuesday introduced the Atlas Partner Directory ...

Slack announces App Directory store
... create more apps for the store, and a new framework called Botkit which should simplify the process of creating apps. The Slack App Directory, ...

Amazon brings Microsoft users into AWS with Active Directory service
Amazon has launched an AWS Directory Service for Active Directory , a fully managed implementation of Microsoft's authentication and user management ...

Security Recruiter Directory
To find the right security job or hire the right candidate, you first need to find the right recruiter. CSO's security recruiter directory is ...

Slack's App Directory proves it's more than just a chatroom
... are about to get a little easier to find and integrate within your team and over 160 of them live within the company's new Slack App Directory. ...

Resources last updated: 3/20/2016 10:54:38 AM