directory access

This is a discussion on directory access within the Tech Board forums, part of the Community Boards category; Hello everyone, When using dir command to list all the files in a directory, for example, here is an output, ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    directory access

    Hello everyone,


    When using dir command to list all the files in a directory, for example, here is an output,

    --------------------
    C:\temp\test>dir
    Volume in drive C is C
    Volume Serial Number is CC95-21FF

    Directory of C:\temp\test

    2006-08-26 16:47 <DIR> .
    2006-08-26 16:47 <DIR> ..
    2006-08-26 16:47 0 foo.txt
    2006-08-26 16:47 0 goo.txt
    2 File(s) 0 bytes
    2 Dir(s) 3,082,964,992 bytes free
    --------------------

    What I want to get are, foo and goo (files ends with .txt). I know how to do this in a programming way, parsing and parsing ... :-)

    Could anyone have any ways which does not need programming, for example, by using some Windows commands (does there are any commmad like grep or cut on Linux)?


    thanks in advance,
    George

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Damnit people! If you're trying to do something which does note need programming then get out of the programming forums!


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,551
    Bordering on being a troll here george
    traverse a directory and list all file names?

    Your questions lack any sense of direction or purpose.
    One minute it's windows, and then it's VxWorks
    Or advanced graphics then simple text parsing.
    What's going on here?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Quote Originally Posted by George2
    (does there are any commmad like grep or cut on Linux)?
    Why not just use grep and awk??? Windows versions are avaliable.

  5. #5
    Registered User
    Join Date
    Aug 2006
    Posts
    62

    Angry

    Quote Originally Posted by George2
    What I want to get are, foo and goo (files ends with .txt)
    What the hell do you mean "get"? As in open? Your question is way too vague...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  2. ww hosting and SSH access
    By spoon_ in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 04-07-2005, 08:49 AM
  3. open directory and copy files
    By 5n4k3 in forum C++ Programming
    Replies: 3
    Last Post: 08-06-2003, 09:49 AM
  4. phone book directory 2
    By arangawawa in forum C Programming
    Replies: 4
    Last Post: 08-01-2003, 05:32 PM
  5. Replies: 6
    Last Post: 07-30-2003, 03:08 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21