VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. Hi

    and the cats.

    However - please how can I insulate the only string (in this case) "0x9D5B4936" in a example.txt like ?

    thanks a lot

    Code:
         Serial #: 
      Fingerprint: 0x9D5B4936
    
             Name: 
            Email: 
           Phone#: 
    
          Company: 
          Website: 
          Address: 
             City: 
            State: 
              Zip: 
          Country:
    output should be simply

    Code:
    0x9D5B4936
    Quote Quote  
  2. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Easy, it happens exactly after "Fingerprint: " and before the carriage return/line feed.
    Search for those elements and get what is in between.

    Btw, I think you mean isolate.

    Scott
    Last edited by Cornucopia; 10th Dec 2022 at 20:24.
    Quote Quote  
  3. Code:
    awk "/Fingerprint/{ print $2 }" example.txt
    0x9D5B4936
    This code uses awk to filter on the text Fingerprint and print the second field $2. Blank space is used as the field delimiter
    Quote Quote  
  4. Originally Posted by jack_666 View Post
    Code:
    awk "/Fingerprint/{ print $2 }" example.txt
    0x9D5B4936
    This code uses awk to filter on the text Fingerprint and print the second field $2. Blank space is used as the field delimiter
    is it for Linux?

    however is there a way using windows and the command "for" "delims"?
    Quote Quote  
  5. is it for Linux?
    This is for windows. For Linux, the call is a little different.


    Download the attacked file, unzip and place in the same folder as example.txt. (It would be infinitely better if you actually place the awk.exe in your windows path)


    Run the code as is.
    Code:
    awk "/Fingerprint/{ print $2 }" example.txt
    Next go to youtube and study more about awk.

    PS : you need to be in the terminal command prompt mode. Hope you know how to do this ... at bottom of windows display enter CMD and cd to the location where the example.txt is located. Still don't know how to do this then ask google ==> command prompt mode
    Image Attached Files
    Last edited by jack_666; 11th Dec 2022 at 17:37.
    Quote Quote  
  6. wow thanks, is works

    Code:
    awk.exe "/Fingerprint/{ print $2 }" "%UserProfile%\AppData\Local\Temp\example.txt"
    it returns correctly:

    Code:
    0x9D5B4936
    but only a thing. And if I need to copy this value on the clipboard? can do this directly from the batch?
    Quote Quote  
  7. And if I need to copy this value on the clipboard? can do this directly from the batch?
    In a batch script, you can do can pipe it (|) to another process or save to another file (>) like below


    Code:
    awk.exe "/Fingerprint/{ print $2 }" "%UserProfile%\AppData\Local\Temp\example.txt" >  "%UserProfile%\AppData\Local\Temp\result.txt"
    Or just use Control C to copy and Control V to paste
    Quote Quote  
  8. Originally Posted by marcorocchini View Post
    And if I need to copy this value on the clipboard? can do this directly from the batch?
    Pipe the output to clip.

    https://www.labnol.org/software/copy-command-output-to-clipboard/2506/
    Quote Quote  
  9. Image
    [Attachment 68154 - Click to enlarge]


    ah wow it works

    Code:
    awk.exe "/Fingerprint/{ print $2 }" "%UserProfile%\AppData\Local\Temp\result.txt" | clip
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!