1. $ cat /Resources/maps_sideScrolling/tileProperties.txt
  2. abc
  3. def
  4. ghi
  5.  
  6. $ cat /Resources/maps_sideScrolling/ruinsItemCave2.tmx
  7. pre
  8. stuff
  9. <tileset firstgid="1"
  10. foo
  11. bar
  12. <layer name="background"
  13. post
  14. stuff
  15.  
  16. $ awk '
  17. NR==FNR { s=s ORS $0; next }
  18. /<tileset firstgid="1"/ { print $0 s; f=1 }
  19. /<layer name="background"/ { f=0 }
  20. !f
  21. ' /Resources/maps_sideScrolling/tileProperties.txt /Resources/maps_sideScrolling/ruinsItemCave2.tmx
  22. pre
  23. stuff
  24. <tileset firstgid="1"
  25. abc
  26. def
  27. ghi
  28. <layer name="background"
  29. post
  30. stuff