Hey, ok, so I have a pretty big text file (350 lines) and the general form looks like this:

Part one
1. 
     .1
             .1 some text
             .2 some more text
     .2 
             .1moreee
     .3        yet more

etc..so it looks like this:

1.1.1 = some text
1.1.2 = some mroe text
1.2.1 = moreee
1.3 = yet more

I have it set up (from ms word) so that it looks like this:

Part one
@1. 
     #.1
             %.1 some text
             %.2 some more text
     #.2 
             %.1moreee

so that everything on tier1 has a @ infront of it, tier 2 has a # and etc...

I did it in excel using the delimiator function in VB...but now I want to get it up into my sql server....I think it would be easiest to just put the word file in a text area in php and have it sort itself out...

So how can i deliminate in php? I was reading about the split() function, but I am not quite sure if that is what I want.

Also, I would like it so that anything starting with a @ goes into field 1, # into field 2 etc (of my sql database) that I can prolly figure out after I know how to properly deliminate stuff..

Any tips would be greatly appreciated 🙂

Here is a link to the .txt file if you want to have a look to see what I am talking about http://pdem.mattwatson.info/Standards/standard.txt

thanks

    for 300 lines, assuming its a one off, its probably faster to copy and paste by hand. What's the source of the data? what's the db field structure?

      Well...300 lines but there are over 30 files >.< so thats a lota copy paste 😛

      the source of the data is a word file seen here:http://pdem.mattwatson.info/Standards/28 13 00 Access Control 2002-12.doc

      the db field structure would look like:

      Part
      tier1
      tier2
      tier3
      tier4
      data
      ID

      so in the example i gave above it would look like this:

      tier1   tier2      tier3     data
      1.  
      .1 .1 some text .2 some more text .2
      .1 moreee .3 yet more

      there would be null entries where there are no .x ...ugh..i have a feeling this is gona be rediculously hard >.<

      Let me know if you need mroe info

        Toadums;10918619 wrote:

        ugh..i have a feeling this is gona be rediculously hard >.<

        me to, sorry, but i think i'll leave you to it, got enough of my own work to do

          dagon;10918624 wrote:

          me to, sorry, but i think i'll leave you to it, got eoug of my own work to do

          Ok, thanks. ill see if i can figure something out lol

            Write a Reply...