Reputation: 395
Using AWK or Sed, how can I remove carriage returns and line feeds from the start of a file before first txt.
Before
TOP OF FILE - Carriage returns and line feeds before txt
<?xml version="1.0" encoding="UTF-8"?>
<fredBaa version="1.2" properties="2.8" Baa="2.13 r1665067">
<hashTree>...
After
TOP OF FILE - No Carriage returns and line feeds before txt
<?xml version="1.0" encoding="UTF-8"?>
<fredBaa version="1.2" properties="2.8" Baa="2.13 r1665067">
<hashTree>...
Upvotes: 2
Views: 1457
Reputation: 89547
you can try this:
awk '/</{a=1}a' file
or to remove all leading lines until the one that has a non-blank character:
awk '/[^[:space:]]/{a=1}a' file
Upvotes: 1