+ Reply to Thread
Results 1 to 11 of 11

Need help with importing data from .txt file

  1. #1
    Registered User
    Join Date
    06-26-2013
    Location
    Mostar
    MS-Off Ver
    Excel 2010
    Posts
    6

    Post Need help with importing data from .txt file

    Hello,

    I'm trying to develop a module for use at work.

    I have a text file from which i need to get data

    This is how the text file looks like
    ----------------------------------------------------------------
    NUM1;CITY;ADDRESS;DATE;
    1;NAME1;1111111111111111;22222222222;
    2;NAME2;1111111111111111;22222222222;
    3;NAME3;1111111111111111;22222222222;
    4;NAME4;1111111111111111;22222222222;
    5;NAME5;1111111111111111;22222222222;
    6;NAME6;1111111111111111;22222222222;
    6;TEXT1.TXT;

    NUM2;CITY;ADDRESS;DATE;
    1;NAME1;1111111111111111;22222222222;
    1;TEXT1.TXT;

    NUM3;CITY;ADDRESS;DATE;
    1;NAME1;1111111111111111;22222222222;
    2;NAME2;1111111111111111;22222222222;
    3;NAME3;1111111111111111;22222222222;
    4;NAME4;1111111111111111;22222222222;
    4;TEXT1.TXT;

    ..............
    ..........
    ............

    What i need is to get data in this order

    text.text - first row
    NUM1 6 - second row (NUM1, 6 - number of names)
    NUM2 1 - third row (NUM2, 1 - number of names)
    NUM3 4 - fourth row (NUM3, 4 - number of names)
    .....
    .....
    .....


    Please help

  2. #2
    Valued Forum Contributor wenqq3's Avatar
    Join Date
    04-01-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    868

    Re: Need help with importing data from .txt file

    i can't understanding your question.
    You have no problem import .txt to excel.
    But you need sort the data after import to excel?
    -If the problem is solved, please mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved".

    -Always upload a workbook before start your question
    To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.

    +++ If my answer(s) helped you, please add me reputation by click on * +++

  3. #3
    Registered User
    Join Date
    06-26-2013
    Location
    Mostar
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need help with importing data from .txt file

    Sorry, yes, exactly like that, i need to sort data after import to excel so that the result looks like this

    A B C
    1 text1.text - CELL A1 (name of text file)
    2 NUM1 6 - CELL A2 (NUM1) , CELL B2 (6 - count number of names under the NUM1)
    3 NUM2 1 - CELL A3 (NUM2) , CELL B3 (1 - count number of names under the NUM2)
    4 NUM3 4 - CELL A4 (NUM3) , CELL B4 (4 - count number of names under the NUM4)
    ....
    ....
    ....

  4. #4
    Valued Forum Contributor wenqq3's Avatar
    Join Date
    04-01-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    868

    Re: Need help with importing data from .txt file

    Okie, but i still can't understand how your want it be sort.
    Since you using the same name, but different color.I can't differential it easily.
    Suggest,
    NUM1;CITY;ADDRESS;DATE;
    1;NAME1;1111111111111111;22222222222;
    2;NAME2;1111111111111111;22222222222;
    3;NAME3;1111111111111111;22222222222;
    4;NAME4;1111111111111111;22222222222;
    5;NAME5;1111111111111111;22222222222;
    6;NAME6;1111111111111111;22222222222;
    6;TEXTa.TXT;
    NUM2;CITY;ADDRESS;DATE;
    1;NAME7;1111111111111111;22222222222;
    1;TEXTb.TXT;
    NUM3;CITY;ADDRESS;DATE;
    1;NAME8;1111111111111111;22222222222;
    2;NAME9;1111111111111111;22222222222;
    3;NAME10;1111111111111111;22222222222;
    4;NAME11;1111111111111111;22222222222;
    4;TEXTc.TXT;


    How it sort?

  5. #5
    Registered User
    Join Date
    06-26-2013
    Location
    Mostar
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need help with importing data from .txt file

    Hello,
    i want them to be sorted like this,I only need
    NUM1 6
    NUM2 1
    NUM3 4

    if it is easy for you, you can completly remove text.txt row, so that after sorting
    i only have

    NUM1 6
    NUM2 1
    NUM3 4

  6. #6
    Registered User
    Join Date
    06-26-2013
    Location
    Mostar
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need help with importing data from .txt file

    or you can do it as you suggested, but to completly remove TEXTa, TEXTb,TEXTc rows
    NUM1;CITY;ADDRESS;DATE;
    1;NAME1;1111111111111111;22222222222;
    2;NAME2;1111111111111111;22222222222;
    3;NAME3;1111111111111111;22222222222;
    4;NAME4;1111111111111111;22222222222;
    5;NAME5;1111111111111111;22222222222;
    6;NAME6;1111111111111111;22222222222;
    6;TEXTa.TXT;
    NUM2;CITY;ADDRESS;DATE;
    1;NAME7;1111111111111111;22222222222;
    1;TEXTb.TXT;
    NUM3;CITY;ADDRESS;DATE;
    1;NAME8;1111111111111111;22222222222;
    2;NAME9;1111111111111111;22222222222;
    3;NAME10;1111111111111111;22222222222;
    4;NAME11;1111111111111111;22222222222;
    4;TEXTc.TXT;

  7. #7
    Valued Forum Contributor wenqq3's Avatar
    Join Date
    04-01-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    868

    Re: Need help with importing data from .txt file

    This is before,
    Please Login or Register  to view this content.
    After is?

    I no see any changes at your post#6 with post#4.

  8. #8
    Registered User
    Join Date
    06-26-2013
    Location
    Mostar
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need help with importing data from .txt file

    I will try to describe as simply as I can.
    1. the first file in the attachment is a text file. : 15062013.txt

    2. another file is what I get when imported into Excel : 15062013.xls
    (on sheet1 is the imported data from 15062013.TXT)
    (on sheet RESULT is what I want)

    this is the original text file 15062013.TXT
    --------------------------------------------------------
    LOND;LONDON;19A WALTON STREET;2013-06-15;
    1;Errol Lyon;4674904370666292;15045658096;
    2;Keneth Brasch;5698067628265408;86423441222;
    3;Edgar Blanding;9685709624245342;78864374880;
    3;15062013.TXT;
    LIVE;LIVERPOOL;94 PORTLAND RD ;2013-06-15;
    1;Duane Brookshire;8290473664535883;63818322108;
    2;Sanford Feit;9949848928489644;96858143472;
    2;15062013.TXT;
    LUTO;LUTON;23 OLD BOND ST;2013-06-15;
    1;Elias Steinman;9648034285052039;28794626915;
    2;Calvin Zweifel;5368041478879064;86597833324;
    3;Kurtis Cocke;1458568230268722;76873963442;
    4;Toney Horn;4070014361632213;12570956595;
    4;15062013.TXT;

    so i want as a result :
    A B
    LOND 3 - (COLUMN A SHORT NAME OF THE CITY - LOND, COLUMN B - NUMBER OF PERSONS - 3: Errol Lyon,Keneth Brasch,Edgar Blanding)
    LIVE 2 - (COLUMN A SHORT NAME OF THE CITY - LIVE, COLUMN B - NUMBER OF PERSONS - 2: Duane Brookshire,Sanford Feit )
    LUTO 4
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor wenqq3's Avatar
    Join Date
    04-01-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    868

    Re: Need help with importing data from .txt file

    Please Login or Register  to view this content.
    I Hope this solve your problem.

  10. #10
    Registered User
    Join Date
    06-26-2013
    Location
    Mostar
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need help with importing data from .txt file

    Thank you very much!

  11. #11
    Valued Forum Contributor wenqq3's Avatar
    Join Date
    04-01-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    868

    Re: Need help with importing data from .txt file

    Welcome, thanks for feed back

+ 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