need a program!! LOOK!!!!

Discussion in 'Programming' started by Hurley, Mar 7, 2008.

  1. #1
    Okay, I have a document filled with a lot of information, but i only need SOME of it.

    Ok, the format of the whole document is this:
    
    
     *** **** ******  * *********** *********** ********   *
    Code (markup):
    the *'s being different info, i need a script, or program that would split each segement of the above into different txt documents, like the first "***" would go into txt1.txt, the "****" would go to txt2.txt, etc

    PLEASE POST IF YOU HAVE SOMETHING THAT CAN DO THIS, OR HAVE A QUESTION.

    (btw the length of the *'s have no importance or relavence)
    Edit/Delete Message
     
    Hurley, Mar 7, 2008 IP
  2. Arkserver

    Arkserver Banned

    Messages:
    2,533
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I can do it.
     
    Arkserver, Mar 7, 2008 IP
  3. Hurley

    Hurley Banned

    Messages:
    94
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Would you do it for free? If so, afterwards I could tip via egold ;)
     
    Hurley, Mar 7, 2008 IP
  4. Arkserver

    Arkserver Banned

    Messages:
    2,533
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I dont use egold so thats a no no.
    A small amount would be nice.
     
    Arkserver, Mar 8, 2008 IP
  5. Hurley

    Hurley Banned

    Messages:
    94
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Alright.....well make it and i gotta see that it works and we will work somethin out
     
    Hurley, Mar 8, 2008 IP
  6. bobb1589

    bobb1589 Peon

    Messages:
    289
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I will do it for you give me a few minutes and i will post a link to the app.
     
    bobb1589, Mar 8, 2008 IP
  7. lephron

    lephron Active Member

    Messages:
    204
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #7
    I've written a python app to do it for you:

    
    outputName = 'output'
    input = open('test.txt')
    for line in input:
    	columnNum = 0
    	for column in line.split(' '):
    		columnNum += 1
    		outputFile = open(outputName + str(columnNum) + '.txt', 'a')
    		outputFile.write(column + '\n')
    		outputFile.close()
    
    Code (markup):
     
    lephron, Mar 8, 2008 IP
  8. Hurley

    Hurley Banned

    Messages:
    94
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Ok bob.

    And lephron, how do i run or compile this???
     
    Hurley, Mar 8, 2008 IP
  9. lephron

    lephron Active Member

    Messages:
    204
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #9
    It's python code. Put it in a file called runme.py, and install python. Then click on it :)
     
    lephron, Mar 9, 2008 IP
  10. daizisheng

    daizisheng Guest

    Messages:
    122
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    78
    #10
    what I can say it is very simple, :)
    especially if you use perl or other like languages
     
    daizisheng, Mar 9, 2008 IP
  11. Hurley

    Hurley Banned

    Messages:
    94
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Daiz - make a prog then please?
     
    Hurley, Mar 9, 2008 IP
  12. Arkserver

    Arkserver Banned

    Messages:
    2,533
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #12
    My offer still stands, I can make a stand alone application customized for your needs but not for free.
     
    Arkserver, Mar 9, 2008 IP
  13. lephron

    lephron Active Member

    Messages:
    204
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #13
    Look at the code - it is very simple.

    input = open('test.txt')
    Code (markup):
    You need to put your input file in the same directory as the python script, and name it test.txt (or change that line of code to load a different file).

    It'll then create files named output<col num>.txt in that directory too. So if you have got the text.txt file in the directory just double click the python file and all your output files will be created!
     
    lephron, Mar 9, 2008 IP
  14. Hurley

    Hurley Banned

    Messages:
    94
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Closed.........
     
    Hurley, Mar 9, 2008 IP