I have a file in the format of:
⌚..⌛ watch..hourglass
⌨️ keyboard
⏏️ eject button
Where some lines contain two entries. I want to break lines with 2 entries into 2 lines like so:
⌚ watch
⌛ hourglass
⌨️ keyboard
⏏️ eject button
Is there a fast way to do this?
My script:
#!/usr/bin/env bash
wget -O output.txt http://www.unicode.org/Public/emoji/6.0/emoji-data.txt
sed -i '/^#/ d' output.txt # Remove comments
sed -i 's/.*(//' output.txt # Remove columns not needed
sed -i 's|[(),]||g' output.txt # Remove brackets around emoji
sed -i 's/\(.*[^ ]\)[ ]*\(.*\)/\2 \1/' output.txt # Move first column to last
sed -i '/^$/d' output.txt # Remove blank lines
Tried @RomanPerekhrest's answer on the following (answer has been updated):
↔️..↙️ left-right arrow..down-left arrow
↩️..↪️ right arrow curving left..left arrow curving right
⌚..⌛ watch..hourglass done
⌨️ keyboard
and it works on watch/hourglass but not the ones above(?)
sed
). You don't even have to make the Python/Perl script a separate file; just embed the script in the bash script.