Open the text document in excel and then use the 'text to columns' tool (which should come up automatically) and check the boxes 'Space' and 'Tab' to convert all the data into columns properly.
Then you need to use a formula to add up all the data:
but i have more than 2 lakh records in TXT file how to count from txt file and place the total in excel (since i cannot copy all the records in excel).
i want to do this using vba programme whn a button is clicked because in the txt file some times records will be 1 lakh or above 1 lakh or 2 lakh so i want the same thing to be done in vba programming.
i want the data to be present like in attached file.
kindly look into that attached file and help me out regarding this.
I would be tempted to import the text file into a xls file and read the data for the first part of the line/Cell. Then use Mid function to extract the country code. Then stop the data in a array or couter for the ammount of times each country is mentioned and display the output in the cells at the end.
Project Focus, with 2 million lines in the text file, it wouldnt be advisable to try and load/import/copy paste them into Excel...
Venu, can we make any assumptions with regard to the data in the text file - for example, will it be sorted in anyway when it is stored in the text file? The samples you provided below seem to be in ascending order by date... will this always be the case.
How many Country codes are there? This is achievable alright, but it will be tough... I might have time to stick some code together over the weekend.
Will the country code on the left be ALWAYS followed by a space?
Will the country code on the left ALWAYS be two characters?
Will the "Year" always have a space after it?
Finally, will there always be 5 distinct columns of data in the text file (seperated by space(s))
Bookmarks