Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Advanced file modification  (Read 6558 times)

0 Members and 1 Guest are viewing this topic.

Batcher



    Rookie

    Thanked: 5
    Re: Advanced file modification
    « Reply #15 on: April 23, 2009, 09:11:41 AM »
    Just closes...I typed in test (one of the first words) and hit enter...it just closed.
    Code: [Select]
    @echo off
    set /p UserInput=Enter:
    if defined UserInput (
      (for /f "usebackq tokens=1-4 delims= " %%a in ("list.txt") do (
        if "%%a" equ "%UserInput%" (
          echo.%%a %%b %%c is
        ) else (
          echo.%%a %%b %%c %%d
        )
      ))>"list_new.txt"
      move /y "list_new.txt" "list.txt"
    ) else (
      echo Your pressed Enter directly. Nothing changed.
      pause
    )
    start "" "list.txt"

    Helpmeh

      Topic Starter


      Guru

    • Roar.
    • Thanked: 123
      • Yes
      • Yes
    • Computer: Specs
    • Experience: Familiar
    • OS: Windows 8
    Re: Advanced file modification
    « Reply #16 on: April 23, 2009, 02:31:37 PM »
    wow, its an invisible error message.

    non GUI user input version
    Code: [Select]
    Set objFS = CreateObject("Scripting.FileSystemObject")
    strFile = "c:\test\list.txt"
    strInput = ""
    WScript.Echo "Enter fname: "
    Do While Not WScript.StdIn.AtEndOfLine
       strInput = strInput & WScript.StdIn.Read(1)
    Loop
    Set objFile = objFS.OpenTextFile(strFile,1)
    Do Until objFile.AtEndOfStream
    strLine = Split(objFile.ReadLine," ")
    If strLine(0) = strInput Then
    strLine(UBound(strLine)) = "is"
    End If
    WScript.Echo Join(strLine," ")
    Loop
    if you are interested to use vbscript, download and read the manual and see what's going on with the script i wrote. that's learning.
    It doesn't change anything...

    Enter fname:
    test
    fnameÿlnameÿyesÿnot
    ffnameÿllnameÿnoÿnot
    testÿtestnameÿnoÿnot
    Where's MagicSpeed?
    Quote from: 'matt'
    He's playing a game called IRL. Great graphics, *censored* gameplay.

    tonlo



      Rookie

      Re: Advanced file modification
      « Reply #17 on: April 24, 2009, 06:55:52 PM »
      my thought the issue here is alt+0160. Look my picture, it automatic change from alt+0160 to alt+0225.



      Helpmeh

        Topic Starter


        Guru

      • Roar.
      • Thanked: 123
        • Yes
        • Yes
      • Computer: Specs
      • Experience: Familiar
      • OS: Windows 8
      Re: Advanced file modification
      « Reply #18 on: April 25, 2009, 09:29:42 AM »
      my thought the issue here is alt+0160. Look my picture, it automatic change from alt+0160 to alt+0225.



      I just realised that I don't need to modify the fourth delimiter, I can send the first delimiter to a different file. Thanks for all your help anyway!
      Where's MagicSpeed?
      Quote from: 'matt'
      He's playing a game called IRL. Great graphics, *censored* gameplay.