Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • alright, that works. thx! Commented Apr 6, 2017 at 9:13
  • 1
    I wonder... Does awk read the whole file into memory when doing it that way? Commented Apr 6, 2017 at 9:17
  • yes.. that's correct. if the file size is very big.. then we encounter with slowness. Commented Apr 6, 2017 at 9:21
  • 1
    Also, I think you need to count one character for the newline in the middle. (Now you're missing the final T from the example.) That gets more annoying if the part to be picked is longer, and especially if the lines are of different lengths for some reason. Commented Apr 6, 2017 at 9:26
  • 2
    @Kusalananda, no, RS= is the paragraph mode. For slurp mode, see Slurp-mode in awk? Commented Apr 6, 2017 at 14:40