+ Reply to Thread
Results 1 to 20 of 20

Any way to import large text file of numbers without Excel splitting numbers?

  1. #1
    Registered User
    Join Date
    07-19-2014
    Location
    New Paltz, NY
    MS-Off Ver
    2010
    Posts
    10

    Question Any way to import large text file of numbers without Excel splitting numbers?

    Hi all,

    I'm not very experienced with Excel and am having a huge problem. I have a text file with rows and columns of numbers ranging from 1-4 digits that I'd like to import/copy into Excel with each number being in its own cell. But whenever I copy/try to import, Excel splits all of the 3-4 digit numbers up into single digit numbers. The text file has 10,000+ columns (each number occupies two columns so I have half of that amount in numbers) and 300+ lines.

    Is the file simply too large for Excel to handle or is there a way I can do this? Any help would be appreciated!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    Hi and welcome to the forum.

    We really need to see the text file and understand what you want to see.
    Save your text file with a new name and edit it so that it only contains a few sample rows and upload it.
    In addition mock up an example Excel sheet that shows what you expect to see after the file has been imported.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    07-19-2014
    Location
    New Paltz, NY
    MS-Off Ver
    2010
    Posts
    10

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    Thank you for the reply,

    Here is a sample of some complete lines from my text file. I want the Excel sheet to look exactly like the text file with the only difference being that each number is within a single cell. Whenever I try to import or copy, Excel shows many more rows than the text file has (10 rows in my file, 20+ showing in Excel). Additionally, none of the triple digit numbers appear (they usually get split up into a single and a double digit number in separate cells), as you can see with the first number, 912 getting split into 9 and 12.

    So I'd expect to see ten rows in my Excel sheet, with the first cell of the first line containing the number 912.
    Attached Files Attached Files

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

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    All the 3 digit numbers appeared to be separated by a Chr(10), I think that's what's causing them to be separated.

    How should the file look once it's been imported to Excel?
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    07-19-2014
    Location
    New Paltz, NY
    MS-Off Ver
    2010
    Posts
    10

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    I may be over-complicating a simple explanation. I don't want anything about the text file to change except that I want each number (i.e., 912, 10, 11, 9) to be in its own cell. I want the same number of rows as are in the text file with the corresponding numbers in each row. To visualize it, I could print out the text file in its current layout and draw a box around each number representing cells in Excel.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    The Text Import Wizard gives this (partial) result:

    A
    B
    C
    D
    E
    F
    1
    9
    2
    12
    10
    11
    9
    9
    7
    3
    14
    11
    10
    8
    8
    9
    4
    12
    13
    9
    8
    10
    9
    5
    13
    10
    10
    9
    10
    10
    6
    14
    10
    10
    8
    9
    10
    7
    14
    10
    10
    9
    8
    7


    Is that what you want?
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    07-19-2014
    Location
    New Paltz, NY
    MS-Off Ver
    2010
    Posts
    10

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    Here's what I want it to look like. This is just a sample of the first five numbers from each row. In reality I need the rest of the rows to be there too. I did this manually.

    Key points:

    -912 in text file turns into 912 in its own cell in Excel, NOT 9 and 12, or 9, 1, and 2, or 91 and 2.
    -Ten rows in text file turns into ten rows in Excel
    Attached Files Attached Files

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    Ignoring the line feeds, which somehow appear in 3-digit numbers, there's only a single line in the file, no? There is no other delimiter (i.e., carriage returns) that I see.
    Last edited by shg; 07-20-2014 at 01:40 PM.

  9. #9
    Registered User
    Join Date
    07-19-2014
    Location
    New Paltz, NY
    MS-Off Ver
    2010
    Posts
    10

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    Here is what I see the text file as:

    There are ten lines/rows. I'd like to preserve that layout.
    Attached Images Attached Images

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

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    Can I ask where this file comes from and what you want to do with it after importing it into Excel?

    Also, that image doesn't show all the data/columns in the file and because of that it's kind of hard to work out how to deal with it.

  11. #11
    Registered User
    Join Date
    07-19-2014
    Location
    New Paltz, NY
    MS-Off Ver
    2010
    Posts
    10

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    The file is originally from an energy technology laboratory and represents voxel coordinates of a rock fracture that I will need to run a simulation on for pressure loss predictions. I am still getting the hang of the computational fluid dynamics software that I'm using so my professor advised that I don't tackle every point/number but rather average groups of them together to make it simpler. So I've been averaging 16x17 blocks of numbers by copy and pasting individual fragments of text lines into Excel but its tedious to the point where there certainly must be an easier way.

  12. #12
    Registered User
    Join Date
    07-19-2014
    Location
    New Paltz, NY
    MS-Off Ver
    2010
    Posts
    10

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    So the method of importation depends on the whole file?

  13. #13
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    I opened the file in Notepad++. I see 24 lines terminated by a linefeed, starting with one after the first 9, and a 25th row with a few more entries. The entries are delimited with tabs.

    If you replace the linefeeds with nothing, that restores the three-digit numbers, but leaves a single row. That's easy enough to do importing the data, but does it give a useful result?
    Last edited by shg; 07-20-2014 at 01:52 PM.

  14. #14
    Registered User
    Join Date
    07-19-2014
    Location
    New Paltz, NY
    MS-Off Ver
    2010
    Posts
    10

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    I suppose I could use some math to alter the single row to suit my calculations, and I think that'd be easier than what I'm currently doing.

    But, if you look at my uploaded file called "Sample Screenshot," there are only 10 lines. Could it be that my version of Notepad is simply choosing to display the text the way that I see it and that different programs will show it differently? That seems to be the case since you see 25 lines, shg.

    Also, I was previously unfamiliar with terms like delimited and linefeed and they make sense to me, but how do you "see" lines terminated by a linefeed? And how do you change that?

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

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    Where does this file come from and what does the data represent?

  16. #16
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    if you look at my uploaded file called "Sample Screenshot," there are only 10 lines.
    I think that's just Notepad's wrapping at the max line width even with Word Wrap turned off
    but how do you "see" lines terminated by a linefeed?
    Download Notepad++; it's a much more capable editor.
    Last edited by shg; 07-20-2014 at 03:48 PM.

  17. #17
    Registered User
    Join Date
    07-19-2014
    Location
    New Paltz, NY
    MS-Off Ver
    2010
    Posts
    10

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    The file is originally from an energy technology laboratory and represents voxel coordinates of a rock fracture that I will need to run a simulation on for pressure loss predictions. I am still getting the hang of the computational fluid dynamics software that I'm using so my professor advised that I don't tackle every point/number but rather average groups of them together to make it simpler. So I've been averaging 16x17 blocks of numbers by copy and pasting individual fragments of text lines into Excel but its tedious to the point where there certainly must be an easier way.

  18. #18
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    There must be a document that describes the output format.

  19. #19
    Registered User
    Join Date
    07-19-2014
    Location
    New Paltz, NY
    MS-Off Ver
    2010
    Posts
    10

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    I just downloaded Notepad++ and made the data into a single row like someone mentioned doing earlier. I could do with that, I'd just have to do a bit of tedious counting and math but compared to my previous method it's much better. But now the fact that different text programs display the same file differently makes me ask a question that I'll have to raise to my professor tomorrow.

    Thanks for the help everyone!

  20. #20
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Any way to import large text file of numbers without Excel splitting numbers?

    The point of using Notepad++ was not to change the data in any way, but just to observe how it's delimited. If the data is voxels (as somebody said) and you want to perform any type of 3D analysis, you need to understand its spatial organization.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to plot a text file having a large block of delimited numbers?
    By macilrae in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 03-31-2013, 03:50 PM
  2. import a large text file into excel
    By Excel_12345 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-03-2013, 04:11 PM
  3. [SOLVED] Macro to import text file. Numbers seperated by ; -> different columns
    By obgle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2012, 09:02 AM
  4. [SOLVED] Import text file from VBA code; import all numbers as text
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-19-2012, 05:19 PM
  5. Splitting large numbers into groups (LATITUDE AND LONGITUDE)
    By craighaylett in forum Excel General
    Replies: 5
    Last Post: 11-16-2009, 12:19 PM

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