#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    8
    Rep Power
    0

    C/C++/Java/PHP code Split text file into multiple text file


    Trying to write Java/C/C++/PHP code to choose text file from computer and split into multiple text file based on field information

    Text file select:

    "First Name","Last Name","Address Line 1","Address Line 2","City","State","ZIP Code","IM Barcode","Sort Position","Tray Number"
    "Stephen","Hight","105 Thurman St","","Carrollton","GA","30117-1955","ADADFTFATTTDADADDFFTAFFFTDDTADDFTFDAFAATDFA AATFATDTFTAAFFAADAFFDT",1,1
    "Kimberly","Kendall","104 Thurman St","","Carrollton","GA","30117-1956","DAAFATDATAFTADDDTTTTADTFATFFDDFTAFDDATDDAAD FTATADADFDTFDAFDDATFDA",2,1
    "James","Boles","108 Thurman St","","Carrollton","GA","30117-1956","DADFDDTFDAFADTFTATADTTDTFATAAFADTATDFTTFAAF TDDFDAFATDTTDTFTFDTTTT",3,1
    "Douglas","Kelley","110 Thurman St","","Carrollton","GA","30117-1956","TFTTTAATDFDAFTDFADFDAFFTTFATATDAAFAATTAFDTD ATFAAFDFAFFTTDTDFFAADD",4,1
    "Christine","Creel","408 Old Mill Dr","","Carrollton","GA","30117-6313","TFDDDTDAFDFFFATDATADFFDAFFTAATTAFDFFTDADDTF TTAFAFATFDATDFTTFTATFF",989,2
    "Elaine","Hobson","410 Old Mill Dr","","Carrollton","GA","30117-6313","DTFFDTAFAFDTADTDDFAFFTDFDTTTDTATDFTDAFTATFA DAAFADDTATTFFTDDTDDFDD",990,2
    "Erica","Tisinger","412 Old Mill Dr","","Carrollton","GA","30117-6313","DFFAAFTDTTADDDATDATATFAFDDFADADFDATTFFAFDDT FFADDTAFTAADTDFDAFADTF",991,2
    "Brandon","Peterson","418 Old Mill Dr","","Carrollton","GA","30117-6313","FTADAAATDATDFTTDTFDFFTTDTTFDTDDDTFAFFATATDF DAADFTDTATDFATAFDADFTT",992,2
    "Robert","Ballard","425 Old Mill Dr","","Carrollton","GA","30117-6314","TFATFFDTADADDAATFTTADFFTFFDFAFAADAAFTAAFDFD FDAFTTFATDFATFFFFTAFAD",993,2
    "Susan","Newbern","429 Old Mill Dr","","Carrollton","GA","30117-6314","AADDFFFFFATADFDTDFFDDDDFTTDTAAFDTADAFDDDAFD ADTFDFDFDDTDTAATTATAAA",994,2
    "M","Motes","431 Old Mill Dr","","Carrollton","GA","30117-6314","TATDAAFTFTTFADFDDFAFATDDAATDADFDFFFTTADDATT AAAFAATAFADDTAFTTFTTFT",995,3
    "Charles","Willis","114 Old Mill Ct","","Carrollton","GA","30117-6317","AFDDTATAADAFFDFFTAATAFTTADDFFDTFFFFDTTADDTT DATDATFFAAAFTFFADFATAD",996,3
    "Nancy","Fox","124 Old Mill Ct","","Carrollton","GA","30117-6317","DFDTATTFFDAAADDDTAATFFFTDFFTFTFFDFDFTFADDDF FADDFDFTAFFADFADTTATFA",997,3
    "Linda","Smith","126 Old Mill Ct","","Carrollton","GA","30117-6317","ATFTDAFTDTTDFTTDAFFDFTTDDADADTDTTFAFFDDATTF TAFAFFDFFADDATTTAFDDTA",998,3
    "Lance","Hatfield","112 Orion Ter","","Carrollton","GA","30117-6318","TDFAFADATAAFFFADATAAFATDTFTTTTAFFFTTFDATDAD ATDAFAFAAFFTAFDFTAFDAA",999,4
    "Dr. Lona","Bibbs","1741 Newnan Crossing Blvd E","","Newnan","GA","30265-1599","TFFTDDTADADTFDFFATFDTTTDAFFTDTDTAFTATFTAADF TFAFADTFAATFTTFTDTTDFT",1000,4


    Split text file:
    split text file1)

    Filename+traynumber 1:

    "First Name","Last Name","Address Line 1","Address Line 2","City","State","ZIP Code","IM Barcode","Sort Position","Tray Number"
    "Stephen","Hight","105 Thurman St","","Carrollton","GA","30117-1955","ADADFTFATTTDADADDFFTAFFFTDDTADDFTFDAFAATDFA AATFATDTFTAAFFAADAFFDT",1,1
    "Kimberly","Kendall","104 Thurman St","","Carrollton","GA","30117-1956","DAAFATDATAFTADDDTTTTADTFATFFDDFTAFDDATDDAAD FTATADADFDTFDAFDDATFDA",2,1
    "James","Boles","108 Thurman St","","Carrollton","GA","30117-1956","DADFDDTFDAFADTFTATADTTDTFATAAFADTATDFTTFAAF TDDFDAFATDTTDTFTFDTTTT",3,1
    "Douglas","Kelley","110 Thurman St","","Carrollton","GA","30117-1956","TFTTTAATDFDAFTDFADFDAFFTTFATATDAAFAATTAFDTD ATFAAFDFAFFTTDTDFFAADD",4,1

    Split Text file 2)
    Filename+traynumber 2:

    "First Name","Last Name","Address Line 1","Address Line 2","City","State","ZIP Code","IM Barcode","Sort Position","Tray Number"
    "Christine","Creel","408 Old Mill Dr","","Carrollton","GA","30117-6313","TFDDDTDAFDFFFATDATADFFDAFFTAATTAFDFFTDADDTF TTAFAFATFDATDFTTFTATFF",989,2
    "Elaine","Hobson","410 Old Mill Dr","","Carrollton","GA","30117-6313","DTFFDTAFAFDTADTDDFAFFTDFDTTTDTATDFTDAFTATFA DAAFADDTATTFFTDDTDDFDD",990,2
    "Erica","Tisinger","412 Old Mill Dr","","Carrollton","GA","30117-6313","DFFAAFTDTTADDDATDATATFAFDDFADADFDATTFFAFDDT FFADDTAFTAADTDFDAFADTF",991,2
    "Brandon","Peterson","418 Old Mill Dr","","Carrollton","GA","30117-6313","FTADAAATDATDFTTDTFDFFTTDTTFDTDDDTFAFFATATDF DAADFTDTATDFATAFDADFTT",992,2
    "Robert","Ballard","425 Old Mill Dr","","Carrollton","GA","30117-6314","TFATFFDTADADDAATFTTADFFTFFDFAFAADAAFTAAFDFD FDAFTTFATDFATFFFFTAFAD",993,2
    "Susan","Newbern","429 Old Mill Dr","","Carrollton","GA","30117-6314","AADDFFFFFATADFDTDFFDDDDFTTDTAAFDTADAFDDDAFD ADTFDFDFDDTDTAATTATAAA",994,2

    Split text file 3)
    Filename+traynumber 3:

    "First Name","Last Name","Address Line 1","Address Line 2","City","State","ZIP Code","IM Barcode","Sort Position","Tray Number"
    "M","Motes","431 Old Mill Dr","","Carrollton","GA","30117-6314","TATDAAFTFTTFADFDDFAFATDDAATDADFDFFFTTADDATT AAAFAATAFADDTAFTTFTTFT",995,3
    "Charles","Willis","114 Old Mill Ct","","Carrollton","GA","30117-6317","AFDDTATAADAFFDFFTAATAFTTADDFFDTFFFFDTTADDTT DATDATFFAAAFTFFADFATAD",996,3
    "Nancy","Fox","124 Old Mill Ct","","Carrollton","GA","30117-6317","DFDTATTFFDAAADDDTAATFFFTDFFTFTFFDFDFTFADDDF FADDFDFTAFFADFADTTATFA",997,3
    "Linda","Smith","126 Old Mill Ct","","Carrollton","GA","30117-6317","ATFTDAFTDTTDFTTDAFFDFTTDDADADTDTTFAFFDDATTF TAFAFFDFFADDATTTAFDDTA",998,3

    Split text file 4)
    Filename+traynumber 4:

    "First Name","Last Name","Address Line 1","Address Line 2","City","State","ZIP Code","IM Barcode","Sort Position","Tray Number"
    "Lance","Hatfield","112 Orion Ter","","Carrollton","GA","30117-6318","TDFAFADATAAFFFADATAAFATDTFTTTTAFFFTTFDATDAD ATDAFAFAAFFTAFDFTAFDAA",999,4
    "Dr. Lona","Bibbs","1741 Newnan Crossing Blvd E","","Newnan","GA","30265-1599","TFFTDDTADADTFDFFATFDTTTDAFFTDTDTAFTATFTAADF TFAFADTFAATFTTFTDTTDFT",1000,4


    Like these, Anyone has an idea how can i write a java code for this??
    Please help me. I am beginners in Java/C/C++/PHP code. My professor told me that simple.
    Please help me guys!!
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,407
    Rep Power
    1871
    Well you're more likely to achieve success by choosing ONE language, and not spamming multiple forums with the same question.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    8
    Rep Power
    0
    lol.. I am just trying to write code to choose text file and split into multiple text files. i know first time. how to choose text file from computer and read that.. but second part i got confused where i need to make multiple text file and split data....
    I was trying write code in Java.. I didn't find any help so.. that's why lol....
    can you please help with Java.. if you know!! Thanks in advanced!!

    Please help!!

IMN logo majestic logo threadwatch logo seochat tools logo