+ Reply to Thread
Results 1 to 3 of 3

Importing multiple text files into Excel, for a complete beginner

  1. #1
    Registered User
    Join Date
    06-26-2013
    Location
    Gotlagotgo
    MS-Off Ver
    Excel 2007
    Posts
    3

    Question Importing multiple text files into Excel, for a complete beginner

    Hi,

    I stumbled upon this forum while searching for a solution to the problem I have, but I've not been successful in applying the suggestions offered in similar threads. I hope someone has the time and interest to help me with this. Here goes:

    I have a couple of hundreds of text files with a defined structure.

    The first set is called sfp-1.txt, sfp-2.txt, ..., sfp-n.txt.

    The content of the sfp files looks like this (although I've shortened it down here for readability):

    Please Login or Register  to view this content.
    The second set is called react-1.txt, react-2.txt, ..., react-n.txt. The content of the react files looks like this (again, shortened down):

    Please Login or Register  to view this content.

    I would like to be able to import this data into separate sheets. In the case of sfp, it would be good if the first column of values (starting with 0.88720 in the example above) could be placed in, say, column A with a title of "k" in cell A1. The second column of values could be placed in column B with a title of "b". The third column is not so important, it just corresponds to the sfp-number.

    For the react files, mainly the first and fourth column are interesting. The values in the first and fourth column of react corresponds to the first and second columns in sfp.

    Furthermore, sfp-1 is related to react-1, and so on. It would therefore be nice to have for example the sfp columns in column A and B (as stated above), and column one and four of react in column D and E. The data of sfp-1 and react-1 could then be placed in one sheet (for simplicity just "sheet1"), then sfp-2 and react-2 in a second sheet, and so on for all the files (at the moment nearly 300*2).

    I would be grateful for any help with the above, but I would be even more grateful if someone could futhermore suggest a way to automatically plot these data. The "k" values (column A and D as suggested above) should be plotted against the "b" values (column B and E as suggested above).

    Thanks a lot in advance.
    Last edited by halldin; 06-28-2013 at 12:49 PM.

  2. #2
    Registered User
    Join Date
    06-26-2013
    Location
    Gotlagotgo
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Importing multiple text files into Excel, for a complete beginner

    I forgot to mention, please ask me to explain better or elaborate if something is unclear. Thanks.

  3. #3
    Registered User
    Join Date
    06-26-2013
    Location
    Gotlagotgo
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Importing multiple text files into Excel, for a complete beginner

    By the way, I also have access to MATLAB. I tried using xlswrite, but can't due to some error making it create csv files instead. I also tried using dlwrite/csvwrite but it won't put the data into different sheets the way xlswrite can.

+ 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