View Single Post
Old 07-14-2018, 06:49 PM   #40
Newly Registered User
Join Date: Dec 2011
Posts: 558
Thanks: 75
Thanked 2 Times in 2 Posts
lookforsmt is on a distinguished road
Re: Help with text file trim and create 2 tables

HI! MajP,
Nice knowing you, I wish i could one day write such codes on my own. It would require a lot of dedication and willingness.
Hope with your codes and explanation i will try to understand and apply in my future projects of similar nature.
Run would be a good name.
PHP Code:
Looking at this there are 2 blocks of informationWithout knowing your process I called a block a "Run". Do you have better name for it
The first "run" is 1101000 and its reasons
The second 
"run" is 1501000 and its reasons 
1,10,1000 or 1,50,1000 can be anything.

PHP Code:
I would put each "reason" in its own table and relate it back to the "run"Unfortunately"run" does not seem to have a unique idBut these two runs occur under
1234567890123 Reference NamePQR
If reference numbers do not repeat then that makes a good natural keyThe first "run" 1101000 would get a primary key of 1234567890123PQR_1 and the second run would get the PK 1234567890123PQR_2All of the reasons would get this run ID as a foreign key to relate back to the run
There will be repetitive Reference & Reference Name. in the data.
Each of them can have anything from
PHP Code:
1101000 denotes
1 as running number starting with 1, 2, 3....
10 is the reference nos which can be anything from 1 to 999999 and
1000 is the amount again can be anything.

Will the above information help you in building the code

Last edited by lookforsmt; 07-14-2018 at 06:55 PM.
lookforsmt is offline   Reply With Quote