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

Author Topic: Exporting / Importing File names from https to Excel / Word  (Read 11896 times)

0 Members and 1 Guest are viewing this topic.

jaidev.anand

    Topic Starter


    Rookie

    • Experience: Familiar
    • OS: Windows 7
    Re: Exporting / Importing File names from https to Excel / Word
    « Reply #15 on: November 15, 2012, 12:10:21 AM »
    No, you would paste the script into a text editor and save it as a filename.bat and be careful not to use a system command as the filename.

    Then:

    Step 1: Create a Text file with the serial numbers as a certain filename
    Step 2: Log in to the https link
    Step 3: save the web page as text with the list of all the files, and save it as a certain filename.
    Step 4: put all the files together and run the batch file, which will create a filelist of the files containing the 8 digit serial numbers.


    Good morning Sir,

    Sorry to come back again! But I'm some how unable to execute Step 4. Could you please advise what is exactly meant by put all the files together and run the batch file...

    Thanks in advance!

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: Exporting / Importing File names from https to Excel / Word
    « Reply #16 on: November 15, 2012, 12:46:41 AM »
    Tell me what you have done and what error messages occur or what happens.


    jaidev.anand

      Topic Starter


      Rookie

      • Experience: Familiar
      • OS: Windows 7
      Re: Exporting / Importing File names from https to Excel / Word
      « Reply #17 on: November 15, 2012, 12:59:58 AM »
      Tell me what you have done and what error messages occur or what happens.

      I'm sure I did something terribly incorrectly. Here's what I did...

      Step 1: Paste the script into a text editor and saved it as a filename.bat (File name = Today)

      @echo off
      del "output file.txt" 2>nul
      for /f "delims=" %%a in (listofserialnumbers.txt) do (
      find "%%a" < "list of files.txt" >>"output file.txt"
      )
      Step 2: Created a Text file with the serial numbers. The file name used is "IDs"
      Step 3: Then I logged into the https link
      Step 4: Saved the web page as text with the list of all the files (Process: Ctrl + S -> Save Type as Text File). File Name is “Nov 14”
      Step 5: Saved 3 Files generated from Step 1, 2 and 4 in C drive
      Step 6: I clicked on the Script File – A CMD window opened for a fraction of second and then closed. Nothing happened… :(


      Please advise...

      Thanks

      foxidrive



        Specialist
      • Thanked: 268
      • Experience: Experienced
      • OS: Windows 8
      Re: Exporting / Importing File names from https to Excel / Word
      « Reply #18 on: November 15, 2012, 01:10:25 AM »
      I'm sure I did something terribly incorrectly. Here's what I did...

      Step 1: Paste the script into a text editor and saved it as a filename.bat (File name = Today)

      @echo off
      del "output file.txt" 2>nul
      for /f "delims=" %%a in (listofserialnumbers.txt) do (
      find "%%a" < "list of files.txt" >>"output file.txt"
      )
      Step 2: Created a Text file with the serial numbers. The file name used is "IDs"  Filename should be listofserialnumbers.txt
      Step 3: Then I logged into the https link
      Step 4: Saved the web page as text with the list of all the files (Process: Ctrl + S -> Save Type as Text File). File Name is “Nov 14” Filename should be  "list of files.txt"
      Step 5: Saved 3 Files generated from Step 1, 2 and 4 in C drive
      Step 6: I clicked on the Script File – A CMD window opened for a fraction of second and then closed. Nothing happened… :(


      Please advise...

      Thanks

      Try it with the above changes.

      jaidev.anand

        Topic Starter


        Rookie

        • Experience: Familiar
        • OS: Windows 7
        Re: Exporting / Importing File names from https to Excel / Word
        « Reply #19 on: November 15, 2012, 06:38:56 AM »
        Try it with the above changes.

        Awesome! Thanks a ton:-)

        This is working superbly. You are the best. Guess, I can't thank you enough. Cheers!!!

        jaidev.anand

          Topic Starter


          Rookie

          • Experience: Familiar
          • OS: Windows 7
          Re: Exporting / Importing File names from https to Excel / Word
          « Reply #20 on: November 16, 2012, 05:48:23 AM »
          Awesome! Thanks a ton:-)

          This is working superbly. You are the best. Guess, I can't thank you enough. Cheers!!!

          Hi Sir,

          Just one additional thing that I noticed...The file name currently being returned is: 20121114-0704-38877796-in.wav14-Nov-2012 07:05 551K

          Is it possible to customize the script to only return this bit 20121114-0704-38877796-in.wav?

          Please advise. Hope it is not too much of a problem!

          Thanks,
          Jai


          foxidrive



            Specialist
          • Thanked: 268
          • Experience: Experienced
          • OS: Windows 8
          Re: Exporting / Importing File names from https to Excel / Word
          « Reply #21 on: November 16, 2012, 06:11:23 AM »
          In your file, is there a space between .wav and the date?

          The reason why I asked three times for a sample of the text is so I could arrange for the filename only, and you wanted CSV format too didn't you?

          jaidev.anand

            Topic Starter


            Rookie

            • Experience: Familiar
            • OS: Windows 7
            Re: Exporting / Importing File names from https to Excel / Word
            « Reply #22 on: November 16, 2012, 06:18:14 AM »
            In your file, is there a space between .wav and the date?

            The reason why I asked three times for a sample of the text is so I could arrange for the filename only, and you wanted CSV format too didn't you?

            Yes Sir. The exact format is 20121114-0704-38877796-in.wav 15-Nov-2012 01:04  479K. I only need 20121114-0704-38877796-in.wav

            Thank you!

            foxidrive



              Specialist
            • Thanked: 268
            • Experience: Experienced
            • OS: Windows 8
            Re: Exporting / Importing File names from https to Excel / Word
            « Reply #23 on: November 16, 2012, 06:29:32 AM »
            Try this:

            Code: [Select]
            @echo off
            del "output file.csv" 2>nul
            for /f "delims=" %%a in (listofserialnumbers.txt) do (
            for /f %%b in ('find "-%%a-" ^< "list of files.txt"') do (
            set /p =""%%b"," >>"output file.csv" <nul
            )
            )
            echo done
            pause

            jaidev.anand

              Topic Starter


              Rookie

              • Experience: Familiar
              • OS: Windows 7
              Re: Exporting / Importing File names from https to Excel / Word
              « Reply #24 on: November 16, 2012, 06:42:32 AM »
              Try this:

              Code: [Select]
              @echo off
              del "output file.csv" 2>nul
              for /f "delims=" %%a in (listofserialnumbers.txt) do (
              for /f %%b in ('find "-%%a-" ^< "list of files.txt"') do (
              set /p =""%%b"," >>"output file.csv" <nul
              )
              )
              echo done
              pause

              Sorry Sir, but this isn't getting the right output. I'm still getting 20121114-0704-38877796-in.wav14-Nov-2012 as the outcome. Apart from this it is coming in Row 1 instead of 1 name in 1 row.

              Please advise.

              « Last Edit: November 16, 2012, 06:55:02 AM by jaidev.anand »

              foxidrive



                Specialist
              • Thanked: 268
              • Experience: Experienced
              • OS: Windows 8
              Re: Exporting / Importing File names from https to Excel / Word
              « Reply #25 on: November 16, 2012, 07:15:56 AM »
              I asked if there was a space between .wav and the date.  You said yes.  Are you now saying no?

              jaidev.anand

                Topic Starter


                Rookie

                • Experience: Familiar
                • OS: Windows 7
                Re: Exporting / Importing File names from https to Excel / Word
                « Reply #26 on: November 16, 2012, 07:19:48 AM »
                I asked if there was a space between .wav and the date.  You said yes.  Are you now saying no?

                Sir,

                There is a space between .wav and the date.

                Thanks!

                foxidrive



                  Specialist
                • Thanked: 268
                • Experience: Experienced
                • OS: Windows 8
                Re: Exporting / Importing File names from https to Excel / Word
                « Reply #27 on: November 16, 2012, 07:24:55 AM »
                Open the file "list of files.txt" and have a good look.

                If you had shown me the first time I asked then we would not be frustrated and writing back and forth and back and forth about the format of the list.

                If there was a space then it would not be in the format you say it is in in the output file.

                jaidev.anand

                  Topic Starter


                  Rookie

                  • Experience: Familiar
                  • OS: Windows 7
                  Re: Exporting / Importing File names from https to Excel / Word
                  « Reply #28 on: November 16, 2012, 07:30:49 AM »
                  Open the file "list of files.txt" and have a good look.

                  If you had shown me the first time I asked then we would not be frustrated and writing back and forth and back and forth about the format of the list.

                  If there was a space then it would not be in the format you say it is in in the output file.

                  Okay, sorry about the trouble. Will not bother. Thanks for the help though.

                  foxidrive



                    Specialist
                  • Thanked: 268
                  • Experience: Experienced
                  • OS: Windows 8
                  Re: Exporting / Importing File names from https to Excel / Word
                  « Reply #29 on: November 16, 2012, 07:34:33 AM »
                  So you take you bat and ball and go home rather than work *with* the people that are solving your problem - for free.