SHARE
TWEET

Untitled

a guest Jun 20th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. STUDENT DETAILS
  2.  
  3. NAME MARKS STD
  4.  
  5. XYZ 20 I
  6.  
  7. RANK SCHOOL TEACHER GRADE
  8.  
  9. 5 TTT ANON B
  10.  
  11. POSITION
  12.  
  13. 5
  14.  
  15. STUDENT DETAILS
  16.  
  17. NAME MARKS STD
  18.  
  19. ABC              40                I
  20.  
  21. RANK SCHOOL TEACHER GRADE
  22.  
  23. 5 TTT ANON A
  24.  
  25. POSITION
  26.  
  27. 5
  28.      
  29. NAME MARKS STD RANK SCHOOL TEACHER GRADE POSITION
  30.  
  31. XYZ  20     I   5    TTT   ANON    B     5
  32.  
  33. ABC  40     I   5    TTT   ANON    A     5
  34.      
  35. awk '/STUDENT DETAILS/{nr[NR];nr[NR+2]; nr[NR+5]; nr[NR+8]}; END {for (i in nr) print nr[i]}' file.txt > filenew.txt
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top