Get line without date – Loop

Welcome Forums General PowerShell Q&A Get line without date – Loop

  • This topic has 4 replies, 3 voices, and was last updated 1 month ago by
    Participant
    .
Viewing 4 reply threads
  • Author
    Posts
    • #221937
      Participant
      Topics: 2
      Replies: 7
      Points: 35
      Rank: Member

      Hi, I need help from experts, I have a txt below, I need to get only the first line of each name.

      Example:

      FILE_INC
      FILE_FULL
      FILE_FULL2

      — Content

      FILE_INC
      24/04/2020 03:00:00

      FILE_FULL
      02/05/2020 00:00:00

      FILE_FULL2
      25/04/2020 00:00:00

      FILE_FULL3
      26/04/2020 01:00:00

      SQL_SRVDESENV_DIARIO_FULL
      23/04/2020 20:30:00

    • #221943
      Participant
      Topics: 3
      Replies: 324
      Points: 1,056
      Helping Hand
      Rank: Community Hero

      Are you saying you have files

      FILE_INC
      FILE_FULL
      FILE_FULL2

      and you want the first line from each file?

    • #221967
      Participant
      Topics: 4
      Replies: 2231
      Points: 5,414
      Helping Hand
      Rank: Community MVP

      Maicon, Please take a moment and (re-)read the very first post on top of the list of this forum: Read Me Before Posting! You’ll be Glad You Did!.

      When you post code or error messages or sample data or console output format it as code, please.
      In the “Text” view you can use the code tags “PRE“, in the “Visual” view you can use the format template “Preformatted“. You can go back edit your post and fix the formatting – you don’t have to create a new one.
      Thanks in advance.

      You should ask a specific question and describe the situation you’re dealing with. Please have in mind: only you can see your screen and only you know your thoughts.

      Até logo.

    • #221979
      Participant
      Topics: 2
      Replies: 7
      Points: 35
      Rank: Member

      Hello Doug, I have a single file with several lines in the format below.
      I just need to get the TITLES.

      content.txt
      TITLE
      DATE

      TITLE
      DATE

      TITLE
      DATE

    • #221982
      Participant
      Topics: 4
      Replies: 2231
      Points: 5,414
      Helping Hand
      Rank: Community MVP

      What have you tried so far? Please show your code. Powershell.org is not a free code writing service. We expect you to spend a little effort yourself solving your problem before asking for help.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.