B
burchill
I am trying to write a kind of parser program, it is supposed to analyse
a guitar tab file (just a plain txt file). It should extract any chord
names in the tab file by trying match any text in the tab file with any
text in a list of chords in (another seperate file);
So far I have loaded both files into string variables and am trying to
search them using the regionMatches string method.
The chords (a list of all chords) file is in this format...
466644 Absus
466644 Absus4
466644 G#sus
466644 G#sus4
545445 A11+
545445 A9(#11)
545555 A7(#10)
545555 A7-10
557585 D7sus
557585 D7sus4
and so on...
The numbers aren't important (they represent the fingering to play that
chord). My main problem is that as you can see the chord names can vary
in length (can be anything from 1 character up to 9).
I am trying to write an algoritm that will take each chord name from the
chord string and then search for it in the tab string. Each chord name
starts on the 9th charcter on each line (including spaces as
chararcters) but they don't all end at the same character on each line.
Is there a way I can create a substring like this...
tab.subSTring(8, end of line);
Can I use the new line \n as a character to search for ?
Any help appreciated.
a guitar tab file (just a plain txt file). It should extract any chord
names in the tab file by trying match any text in the tab file with any
text in a list of chords in (another seperate file);
So far I have loaded both files into string variables and am trying to
search them using the regionMatches string method.
The chords (a list of all chords) file is in this format...
466644 Absus
466644 Absus4
466644 G#sus
466644 G#sus4
545445 A11+
545445 A9(#11)
545555 A7(#10)
545555 A7-10
557585 D7sus
557585 D7sus4
and so on...
The numbers aren't important (they represent the fingering to play that
chord). My main problem is that as you can see the chord names can vary
in length (can be anything from 1 character up to 9).
I am trying to write an algoritm that will take each chord name from the
chord string and then search for it in the tab string. Each chord name
starts on the 9th charcter on each line (including spaces as
chararcters) but they don't all end at the same character on each line.
Is there a way I can create a substring like this...
tab.subSTring(8, end of line);
Can I use the new line \n as a character to search for ?
Any help appreciated.