I am currently working on a project in Ruby on Rails (in Eclipse), and my task is to break the data block into the appropriate parts using regular expressions.
I decided to split the data based on 3 parameters:
- The string must begin with a capital letter (equivalent to RegEx -
/^[AZ]/ ) - It should end in: (equivalent to RegEx -
/$":"/ )
I would appreciate any help .... The code I use in my controller is:
@f = File.open("report.rtf") @fread = @f.read @chunk = @fread.split(/\n/)
where @chunk is the array to be created by the partition, and @fread is the data that is split (in new lines).
Any help would be appreciated, thanks a lot!
I canβt release accurate data, but it mostly happens (this is related to medicine)
Exam 1: CBW 8080
RESULT:
This report is dictated by specific measurements. Please see the Initial Report.
COMPARE: 1/30/2012, 3/8/12, 4/9/12
RECIST 1.1: BLAH BLAH BLAH
An ideal output would be an array that says:
["Exam 1:", "CBW 8080", "RESULT", "This report is dictated with specific measurement. Please see the original report.", "COMPARISON:", "1/30/2012, 3/8/12, 4/9/12", "RECIST 1.1:", "BLAH BLAH BLAH"]
PS I just use \ n as a placeholder until I get it working