Issue
Can anybody help me with this? I have a bunch of text-files, that I want to alter. They all start with something else but a normal alphabetical character. I now want to delete everything before the appearnace of a alphabetical character, so that they start with their title,keeping everything else following intact.
here's an example:
=================================================================================
TITLE OF SONG
Text text text
Text text text
ReFrain:
Text text text
written 16.08.1998
And I want it to look like this
TITLE OF SONG
Text text text
Text text text
ReFrain:
Text text text
written 16.08.1998
I tried doing it like this:
for f in *.txt; do sed 's/^.*[a-zA-Z]/^.[a-zA-Z]/g'; done
It is not working
I'm fairly new to this, so please bear with me.
best Stef
Solution
Perl is handy here:
perl -0777 -i -pe 's/^[^[:alpha:]]+//s' file ...
The -0777 option causes perl to slurp the entire file into the default variable,
and the s/// command removes all leading non-alpha characters.
Answered By - glenn jackman Answer Checked By - Katrina (WPSolving Volunteer)