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*

11
  • What is it you are looking for? You mention you want to learn. However on this site you are likely to receive pre-chewed answers that may not advance your learning that much. One tip; you seem to believe that "i" has some special meaning. In the samples posted "i" is nothing more than the letter "i". Commented Oct 22, 2015 at 7:43
  • Edited the question. Hope u will understand. At least give some pointers to resolve the issue, instead of ignoring it. Commented Oct 22, 2015 at 8:46
  • Since your data appears to consist of structured data records, I'd look at using awk or perl in 'paragraph mode' rather than sed. FWIW I don't see the relevance of the ksh tag here since you seem to be looking for a solution using external text-processing tools rather than the shell itself. Commented Oct 22, 2015 at 10:17
  • @steeldriver yes i am also working on different options like i had used grep -n -w filename.txt but still i am not fully satisfied. Commented Oct 22, 2015 at 10:21
  • OK so here's a freebie to get you started: awk 'BEGIN{RS=""} END{print NR}' Commented Oct 22, 2015 at 10:30