+ Reply to Thread
Results 1 to 15 of 15

importing info from text file with multiple heading through document to excel

  1. #1
    Registered User
    Join Date
    01-12-2013
    Location
    redcliffe q, australia
    MS-Off Ver
    Excel 2003
    Posts
    8

    importing info from text file with multiple heading through document to excel


    hi all, i'm new to the forum
    i receive a text file which has multiple text/numeric headings throughout the document and info in text and numeric
    i want to import the info into excel 2003 displaying the info in rows and columns but retain the numerous headings

    i can open the text file in excel using fixed width but this action disects the header into multiple cells which is not suitable. i've spent many challenging hours trying different methods but have to admit failure

    i want the header to be exported in column A and the info in rows and columns under each header.
    the document sometimes has 80 headings

    i've attached the text file and would appreciate any help

    basicially i want the header in column A and under it in column A no, column B form, column C horse, column D wodds and so on

    regards
    neale
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: importing info from text file with multiple heading through document to excel

    Neale

    When you open the file isn't all the data in the correct columns?

    The only problem is the race name etc being split across multiple columns, so why not reconstruct that part?
    If posting code please use code tags, see here.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: importing info from text file with multiple heading through document to excel

    Hi Neale and welcome to the forum

    I loaded your file into excel using "delimited", using "space" as the delimiter, and seemed to have good success. Have you tried it that way yet?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    01-12-2013
    Location
    redcliffe q, australia
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: importing info from text file with multiple heading through document to excel

    Hi FDibbins
    thanks for your prompt response
    unfortunately when using the space as a delimiter, the data seems to be in columns in the example but when you examine the spreadsheet the info is not in the correct columns
    ie column A has the race time and under it the column for no but no numbers, this pushes all info across other columns, the worst example is a horse with 2 names the first name is in the woods column and the second name goes in the next column but a horse with only one name the price is in the same column as the second name of the other horse
    but thanks for your response, i've tried the delimiter and fixed width but i think it requires visual basic code to
    find the race heading, cut and paste it to column A in a spreadsheet
    then count down 6 rows and cut and paste the info in column A (no is in column A) and the other info in columns to the right
    i'd need this to be repeated to accommodate up to 1500 rows
    damm complicated for me

  5. #5
    Registered User
    Join Date
    01-12-2013
    Location
    redcliffe q, australia
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: importing info from text file with multiple heading through document to excel

    Hi Norie
    Thanks for your prompt response
    i've done that a couple of days so far but its extremely time consuming and open to retyping errors as the header is split over so many columns
    i have to do this every day, so i'd really like to automate it
    i think visual basic code might be the answer
    ie write code to cut and paste the header in column A on a spreadsheet
    then count down 6 rows and cut and paste the info in columns from column A (no to be column A) and the other info in columns to the right
    regards

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: importing info from text file with multiple heading through document to excel

    Neale

    I was thinking that the file could first be imported without any delimiters, fixed width stuff etc

    Then go through the data splitting each row as required.

    All with code.

  7. #7
    Registered User
    Join Date
    01-12-2013
    Location
    redcliffe q, australia
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: importing info from text file with multiple heading through document to excel

    hi norie
    i can't import the file into excel without delimiting as the text import wizard automaticially starts when opening opening xl, file, open, the text file

    can you suggest how i could open it and what code to use to split each row
    thanks

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Yes you can, both manually and with code.

    Manually you would choose Fixed width but remove all the breaks Excel adds.

    The code's pretty straightforward too.

  9. #9
    Registered User
    Join Date
    01-12-2013
    Location
    redcliffe q, australia
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: importing info from text file with multiple heading through document to excel

    hi norrie
    i opened the file in xl and removed all the column brakes as you suggested
    all the text file info is now visable but obviously not in columns
    how do i get the info into the correctcolumns now?

  10. #10
    Registered User
    Join Date
    01-04-2013
    Location
    United
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: importing info from text file with multiple heading through document to excel

    Deleted - spam
    Last edited by FDibbins; 01-13-2013 at 08:23 AM.

  11. #11
    Registered User
    Join Date
    01-12-2013
    Location
    redcliffe q, australia
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: importing info from text file with multiple heading through document to excel

    hi janisjohan29
    what info are you providing to me
    i don't understand what you say "ind some good information that is so creative and use full method and I hope next we found a good information."

  12. #12
    Registered User
    Join Date
    01-04-2013
    Location
    United
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: importing info from text file with multiple heading through document to excel

    I Read your forum and find some use full information./

  13. #13
    Registered User
    Join Date
    01-12-2013
    Location
    redcliffe q, australia
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: importing info from text file with multiple heading through document to excel

    hi janisjohan29
    yes the forum is excellent and does provide much useful info
    hopefully with the gracious help of people like norie and others i'll have a solution to my problem

  14. #14
    Registered User
    Join Date
    01-04-2013
    Location
    United
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: importing info from text file with multiple heading through document to excel

    Thanks for replay me............ One of the time such as 3 years ago I was use Exxcel 2003. But now I use Excel 7.. Its comfortable and easy to use I think .. Can you tell me Excel new version condition what.....

  15. #15
    Registered User
    Join Date
    01-12-2013
    Location
    redcliffe q, australia
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: importing info from text file with multiple heading through document to excel

    hi norie
    could you advise me the code you mentioned to split the info into columns or any other method as i have imported the info from the text file, fixed width and rem,oved the column breaks
    and i can't work out what to do now
    thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1