crodseth Posted December 7, 2006 Share Posted December 7, 2006 I have a notes field (actually 2700+ notes fields) that contains the contents of a word document. I am trying to break apart this notes field, so that I can save the information into proper fields. Please see an example of the notes field below:May 20, 1997 -- SHIPPING REPORTW.O. CUSTOMER DESCRIPTION QTY CARRIER 12237-1 Robinson Power Fuel sending unit 1-C U.P.S.13209 Jackson Power 3306 gen set w/trailer-enclosure 1-P Inway Trans. ENG SN: 9NR0141313227 Jackson Power Touch up paint W U.P.S.As you can see, the notes field contains what essentially should be three separate records. What I'd like to do is break this apart somehow and resave it to a separate table as three separate records, each with the date at the top of the notes fields. I know I can do a little bit of exploding to break down certain parts, however the patterns on these note fields are not always the same. For example the second 'record' on this notes field has a second line. I'm just wondering if anybody has any words of wisdom. The fields are tab separated, so I can explode them with \t but after that I'm lost. Thank you. Link to comment https://forums.phpfreaks.com/topic/29836-help-breaking-notes-field-into-separate-fields-records/ Share on other sites More sharing options...
drifter Posted December 7, 2006 Share Posted December 7, 2006 between records it looks like a blank line right? I did this once and I had to replace in my entire file all double line breaks with a | - then I replace all line breaks with '' (nothing) - this gave me a long line with | seperating the records. Then I replaced | with a new line break - now there is one record per line and you can explode on \tHope this helps Link to comment https://forums.phpfreaks.com/topic/29836-help-breaking-notes-field-into-separate-fields-records/#findComment-137068 Share on other sites More sharing options...
crodseth Posted December 7, 2006 Author Share Posted December 7, 2006 Thank you drifter...very helpful!!! Link to comment https://forums.phpfreaks.com/topic/29836-help-breaking-notes-field-into-separate-fields-records/#findComment-137075 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.