דילוג לתוכן
  • חוקי הפורום
  • פופולרי
  • לא נפתר
  • משתמשים
  • חיפוש גוגל בפורום
  • צור קשר
עיצובים
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • ברירת מחדל (ללא עיצוב (ברירת מחדל))
  • ללא עיצוב (ברירת מחדל)
כיווץ
לוגו מותג
  1. דף הבית
  2. מחשבים וטכנולוגיה
  3. עזרה הדדית - מחשבים וטכנולוגיה
  4. type לשורה אחת

type לשורה אחת

מתוזמן נעוץ נעול הועבר נפתר עזרה הדדית - מחשבים וטכנולוגיה
6 פוסטים 3 כותבים 97 צפיות 2 עוקבים
  • מהישן לחדש
  • מהחדש לישן
  • הכי הרבה הצבעות
תגובה
  • תגובה כנושא
התחברו כדי לפרסם תגובה
נושא זה נמחק. רק משתמשים עם הרשאות מתאימות יוכלו לצפות בו.
  • נ נחנ מנותק
    נ נחנ מנותק
    נ נח
    כתב ב נערך לאחרונה על ידי נ נח
    #1

    יש כזה דבר? חיפשתי ולא מצאתי
    a.txt

    name
    0000
    

    bat

    type a.txt
    

    אפשר לעשות שcmd יקרא רק את name/0000?

    MENISM chvC 3 תגובות תגובה אחרונה
    0
    • נ נחנ נ נח

      יש כזה דבר? חיפשתי ולא מצאתי
      a.txt

      name
      0000
      

      bat

      type a.txt
      

      אפשר לעשות שcmd יקרא רק את name/0000?

      MENISM מנותק
      MENISM מנותק
      MENIS
      כתב ב נערך לאחרונה על ידי
      #2

      @נ-נח נסה להיעזר בעמוד זה

      תגובה 1 תגובה אחרונה
      2
      • נ נחנ נ נח

        יש כזה דבר? חיפשתי ולא מצאתי
        a.txt

        name
        0000
        

        bat

        type a.txt
        

        אפשר לעשות שcmd יקרא רק את name/0000?

        MENISM מנותק
        MENISM מנותק
        MENIS
        כתב ב נערך לאחרונה על ידי
        #3

        @נ-נח לחילופין תוכל להשתמש בסקריפט פאוור של שכולל פקודה מתאימה

        Example 3: Get a specific line of content from a text file

        This command gets a specific number of lines from a file and then displays only the last line of that content. The TotalCount parameter gets the first 25 lines of content. This example uses the LineNumbers.txt file that was created in Example 1.

        (Get-Content -Path .\LineNumbers.txt -TotalCount 25)[-1]
        
        This is Line 25
        

        The Get-Content command is wrapped in parentheses so that the command completes before going to the next step. Get-Contentreturns an array of lines, this allows you to add the index notation after the parenthesis to retrieve a specific line number. In this case, the [-1] index specifies the last index in the returned array of 25 retrieved lines.

        כמבואר בעמוד זה
        אם תצטרך עוד הסבר אשמח לעזור כמידת יכולתי

        נ נחנ תגובה 1 תגובה אחרונה
        2
        • נ נחנ נ נח

          יש כזה דבר? חיפשתי ולא מצאתי
          a.txt

          name
          0000
          

          bat

          type a.txt
          

          אפשר לעשות שcmd יקרא רק את name/0000?

          chvC מנותק
          chvC מנותק
          chv
          כתב ב נערך לאחרונה על ידי chv
          #4

          @נ-נח לעשות זאת על ידי TYPE זה באמת מסובך (תוכל לראות כאן סקריפט שמבצע את הפעולה הזאת. אבל בתכלס גם הוא לא משתמש בסופו של דבר בTYPE אלא מכין לך פונקציה חדשה שמבצעת את זה)
          אני מציע להשתמש במקום זאת בECHO. פשוט צור משתנה מהקובץ הרצוי (set /p var = <a.txt) ואז תעשה עליו echo (ככה %echo %var)

          נ.ב. בדיוק כשכתבתי כתב גם @MENIS הפניה לסטאק. מה שיש שם זה גם שימושי, אם כי משתמש בפווארשל לפי מה שראיתי בהצצה ראשונה.
          בפווארשל פשוט אפשר לקבל תוכן של קובץ לפי שורות, עם כל הפרמטרים המקובלים (נגיד [0](Get-Content a.txt) בפווארשל, ייתן לך שורה ראשונה של הקובץ)

          בלוג

          תגובה 1 תגובה אחרונה
          3
          • MENISM MENIS

            @נ-נח לחילופין תוכל להשתמש בסקריפט פאוור של שכולל פקודה מתאימה

            Example 3: Get a specific line of content from a text file

            This command gets a specific number of lines from a file and then displays only the last line of that content. The TotalCount parameter gets the first 25 lines of content. This example uses the LineNumbers.txt file that was created in Example 1.

            (Get-Content -Path .\LineNumbers.txt -TotalCount 25)[-1]
            
            This is Line 25
            

            The Get-Content command is wrapped in parentheses so that the command completes before going to the next step. Get-Contentreturns an array of lines, this allows you to add the index notation after the parenthesis to retrieve a specific line number. In this case, the [-1] index specifies the last index in the returned array of 25 retrieved lines.

            כמבואר בעמוד זה
            אם תצטרך עוד הסבר אשמח לעזור כמידת יכולתי

            נ נחנ מנותק
            נ נחנ מנותק
            נ נח
            כתב ב נערך לאחרונה על ידי
            #5

            @menis אמר בtype לשורה אחת:

            @נ-נח לחילופין תוכל להשתמש בסקריפט פאוור של שכולל פקודה מתאימה

            Example 3: Get a specific line of content from a text file

            This command gets a specific number of lines from a file and then displays only the last line of that content. The TotalCount parameter gets the first 25 lines of content. This example uses the LineNumbers.txt file that was created in Example 1.

            (Get-Content -Path .\LineNumbers.txt -TotalCount 25)[-1]
            
            This is Line 25
            

            The Get-Content command is wrapped in parentheses so that the command completes before going to the next step. Get-Contentreturns an array of lines, this allows you to add the index notation after the parenthesis to retrieve a specific line number. In this case, the [-1] index specifies the last index in the returned array of 25 retrieved lines.

            כמבואר בעמוד זה
            אם תצטרך עוד הסבר אשמח לעזור כמידת יכולתי

            לפי מה שהבנתי משם זה הקוד

            (Get-Content -Path .\LineNumbers.txt -TotalCount 25)[-1]
            

            וזה התוצאה

            This is Line 25
            
            MENISM תגובה 1 תגובה אחרונה
            0
            • נ נחנ נ נח

              @menis אמר בtype לשורה אחת:

              @נ-נח לחילופין תוכל להשתמש בסקריפט פאוור של שכולל פקודה מתאימה

              Example 3: Get a specific line of content from a text file

              This command gets a specific number of lines from a file and then displays only the last line of that content. The TotalCount parameter gets the first 25 lines of content. This example uses the LineNumbers.txt file that was created in Example 1.

              (Get-Content -Path .\LineNumbers.txt -TotalCount 25)[-1]
              
              This is Line 25
              

              The Get-Content command is wrapped in parentheses so that the command completes before going to the next step. Get-Contentreturns an array of lines, this allows you to add the index notation after the parenthesis to retrieve a specific line number. In this case, the [-1] index specifies the last index in the returned array of 25 retrieved lines.

              כמבואר בעמוד זה
              אם תצטרך עוד הסבר אשמח לעזור כמידת יכולתי

              לפי מה שהבנתי משם זה הקוד

              (Get-Content -Path .\LineNumbers.txt -TotalCount 25)[-1]
              

              וזה התוצאה

              This is Line 25
              
              MENISM מנותק
              MENISM מנותק
              MENIS
              כתב ב נערך לאחרונה על ידי MENIS
              #6

              @נ-נח כמובן, בשורה הראשונה אתה כותב את מספר השורות המלא מימין לtotal count ואז מעבר לסוגר את מספר השורה הדרוש ב[]

              תגובה 1 תגובה אחרונה
              2

              • התחברות

              • אין לך חשבון עדיין? הרשמה

              • התחברו או הירשמו כדי לחפש.
              • פוסט ראשון
                פוסט אחרון
              0
              • חוקי הפורום
              • פופולרי
              • לא נפתר
              • משתמשים
              • חיפוש גוגל בפורום
              • צור קשר