Need scripting help (Win) - remove lines in .csv that contain a specific term

Discussion in 'Computer Support' started by Thomas Adams, Aug 3, 2004.

  1. Thomas Adams

    Thomas Adams Guest


    I need to write a script for Windows XP either in JScript oder WScript.
    The reason for this choice of languages is simply that this way none of
    the script's users needs to install separate software.

    The script should take a .csv file, check all lines for the presence of
    a specific term ('peter.pan') and if this term occurs in a line, it
    should delete the line from the .csv file.

    A sample of the .csv file:


    The script would delete the 2nd line of this sample.

    Could somebody please help me? Are there perhaps script "skeletons"
    somewhere that one could modify to one's liking?

    Thomas Adams, Aug 3, 2004
    1. Advertisements

  2. Thomas Adams

    Tech Guest

    This sort of thing is done all the time under Linux using shell scripting
    and commands such as 'grep'.

    You may want to post your question in a NG that specializes in shell
    Tech, Aug 5, 2004
    1. Advertisements

  3. Thomas Adams

    Duane Arnold Guest

    You'll want to look at the FileSystemObject that's on the O/S.

    IMHO, you should be able to get a Microsoft Press Book that
    will give you the basics on the Jscript or Wscript languages. The books
    should have some programming examples you look at.

    You may also be able to use Google to search for some Jscript or Wscript
    examples to help you put it together.

    It's not a hard task you looking to do programming wise.

    Duane :)
    Duane Arnold, Aug 5, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.