1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: How to open a text file

Discussion in 'DOS/Other' started by screamoon, Jul 19, 2006.

Thread Status:
Not open for further replies.
Advertisement
  1. screamoon

    screamoon Thread Starter

    Joined:
    Jul 19, 2006
    Messages:
    9
    Hi,

    I am trying to make a batch script that would open a text file and then read it's contents. Is there a direct command to do that in batch ?

    Any help would be appreciated

    Thanking you
    scream
     
  2. StumpedTechy

    StumpedTechy

    Joined:
    Jul 7, 2004
    Messages:
    7,234
    You mean read as in audio out of the speakers? Or read as in parsing out the information for futher use in the batch file?
     
  3. screamoon

    screamoon Thread Starter

    Joined:
    Jul 19, 2006
    Messages:
    9
    What I mean is suppose I have a text file with some file names.......I want to read the contents of the text file ( which would be some file names) and then compare those names with the files stored in some folder. I would be comparing by names......


    Please help

    Thank you
     
  4. screamoon

    screamoon Thread Starter

    Joined:
    Jul 19, 2006
    Messages:
    9
    @echo off
    for /f %%a in (Files.txt) do attrib +h Output\%%a
    del Output\*.*
    for /f %%a in (Files.txt) do attrib -h Output\%%a


    This is the script I am using but I am not getting the desired output. Please help me in debugging this issue.

    For more information on my issue check my post called " Deleting Files Through Batch"

    THank you..
     
  5. StumpedTechy

    StumpedTechy

    Joined:
    Jul 7, 2004
    Messages:
    7,234
    Do the file names in the text file have long names? or are they 8.3 compliant? Also do you have the .3 portion of the filename in ther e or is it going against just partial file names?
     
  6. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    Whtat about using the good ole Type command.
     
  7. squidboy

    squidboy

    Joined:
    Dec 29, 2004
    Messages:
    403
    If I read this correctly, you want to hide every file name that matches, then delete all the rest, then unhide them. Is that correct?
     
  8. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Solved open text
  1. alanh01
    Replies:
    7
    Views:
    228
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/484531

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice