How can i peak up these 3 points(6,4 and 3) and corresponding 1st column value like(7,14,21)above.
By the help of expert brother, i got the following code to input 2 column from txt file, is given bellow:
here test1 and test2 is 2 column. I am really waiting for it...

Well, I have something that might help you. This will get the last character of each line, which, by your columns, should be the heighest in that line, and will get it's position from the last line, which presumably defines the "columns".Note: This applies only if the file is as you posted, with the columns decreasing e.g. 6 -> 4 -> 3. If the file has another format, it won't work, e.g. if the file is like 4 -> 3 -> 6.

#include <fstream>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(){
string filename = "clm.txt"; //file from which you'll read
vector<string> lines; //will store all the lines from the file
vector<char> numbers; //will store the numbers from that line
vector<pair<char, string> > heights; //will store the pairs number - column position
ifstream fin (filename.c_str(), ios::in);
string line;
if (fin.good()){ //check if the stream is good
while (getline(fin, line)){ //gets the line from the file
string::reverse_iterator rit = line.rbegin();
while (*(rit) != '\n' && *(rit) == ' ') rit++; //checks where's the last character,
//which isn't a new line or a whitespace
numbers.push_back(*(rit)); //store the corresponding number
lines.push_back(line); //store the entire line
}
}
int size = (int)lines.size()-1; //get the size of the lines vector (to
//actually see the position of the column line)
for (int i=0;i<size;i++){ //iterate over the vector
string part;
int pos = (int)lines[i].rfind(numbers[i]); //get the last position in the line where the number
//is encountered.
if (lines[size][pos] == ' ') //if the position in the column line is a whitespace,
while (lines[size][pos++] != ' '); //than increase the position until a non-white space
//character is fount
while (lines[size][pos] != ' ') //if the number is greater than 9, it is composed
part.push_back(lines[size][pos++]); //of multiple characters. get them all!
heights.push_back(pair<char, string>(numbers[i], part)); //save the pair number - position
}
for (int i=0;i<(int)heights.size();i++){
cout<<heights[i].first<<" : "<<heights[i].second<<endl;
}
return 0;
}

This is just an example. Now you'll have to find a way to get your desired positions. Also, the file I used looks like this:clm.txt:

If the file contains only two columns, the position and the number follow this pseudocode:

peeks = vector of pairs
tempNumber = tempPos = pos = number = 0
while stream is good do
tempPos = first number from stream
tempNumber = second number from stream
if number <= tempNumber then
number = tempNumber
pos = tempPos
else
peeks.push_back (pair of number, pos)
while stream is good do
tempPos = first number from stream
tempNumber = second number from stream
if number < tempNumber then
exit_loop/break
end_if
number = tempNumber
end_while
end_if
end_while

So you start from a "valley", and you "climb" to a "peak/summit". If your tempNumber is smaller than the number, than you've reached a peak, and you'll "descend" until you find yourself in another "valley", or the end of the file. So, you'll start "descending" and, when you've reached the lowest point, when number isn't smaller than the tempNumber, than you'll start "climbing" again, and on that moment, you redo the whole algorithm, until you have found all the peaks.

Funny how the line doesn't start with one and ten is represented as a 0. The double digits also add an extra degree of complexity. For that reason alone, I would consider representing and storing this as a 2 dimensional array. Then I don't think you can go too far wrong.

Dear
Lucaci Andrew, I am really new to programing, I understood that you tried for me a lot. Can you now, give me an example about how to put your 2nd coding with my 2 coloum, and for you kind information, column may have fraction/decimal values. these colum is bellow...

There's not much to be explained, since I gave you the pseudocode. Again, go throughout your file and see when you've "hit" a "peak". You'll notice at some point that your previous number will not be greater than your current, so you actually found a peak.
Your brother gave you some methods of how to get the numbers from your file, I'll go with that.
So, as to initalizing the variables, I've choosen to get a pair of two ints, which represents the number and the position, and I'll be storing these pairs in a vector:

vector<pair<int, int> > peaks;

If you don't know how to tackle pairs, here's an useful link: Click Here
Also, I've mentioned something related to tempPos and tempNumber, you should initialized them as follows:

int pos = 0, number = 0, tempPost = 0, tempNumber = 0;

You'll be needing the ifstream object to actually read from the file; my file is called cln.txt

string filename = "cln.txt";
ifstream fin(filename.c_str(), ios::in);

Now you have your basic elements from the top of the pseudocode. What's next is the iteration of the while:

while (fin.good())

That assures that your stream (fin) is good, and ready to be read from. On how to actually get the numbers, your brother gave you some heads up to this matter:

fin>>tempPost>>tempNumber;

As you probably noticed by now, you are extracting the first 2 numbers from the stream (that is, your columns from your the file). If you are unclear about the extracting operator>> have a look at this: Click Here
Following the pseudocode, you now have entered the while, and populated your temp variables with data from your text file. The next thing is the if contition:

if (number <= tempNumber) {
number = tempNumber;
pos = tempPost;
}

That says pretty much this: if your number is smaller than the tempNumber, you assign the current number to be tempNumber: you're "climbing to a peak". You're also storing the position, since it's needed. Onto the second part of the if condition, the else part:

So, you have found a "peak". You'll be storing it into your "peaks" vector, and you'll descend until you are in a "valley", that is the second while. Since the elements from your descending are not a concern to you, you actually keep track of your number and your tempNumber to see when you've reached the "valley", but you ignore the position. When you indeed got in a "valley", the algorithm repeats, until you've reached the end of the file.

I pretty much gave you the solution here, but I do hope you'll understand something from this.

Dear
Lucaci Andrew, I guess you think I am little bit good in programing, But no i am not. even I can't get how to combine your coding to my first coding....ohhhh feel really sorry. Can you give me now a complete post!!! otherwise this really uselees diamond to me !!!

It won't be if you start thinking a bit it, gluing all the pieces of code I gave you. I cannot go further with my explanations, since you haven't provided any actual work in solving this problem. Indeed, you posted some code ripped off your 'expert brother', but I fail to see your actual work.