cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
convert a fasta file into a pair with T1
convert a fasta file into a pair with T1 and T2 being strings
Oct 18, 2017 at 7:48pm UTC
Danielsg94
(1)
Should be a simple problem.
I have a fasta file with n rows, and now I need to put it in a pair with the first row being T1 and T2 should be the second until the n-th row and should be a string wihtout returns or breaks of any kind.
what I have right now is:
ifstream inFile;
inFile.open("myFasta.fasta");
string x, y;
inFile >> x >> y;
pair <string,string> fasta_file;
fasta_file = make_pair(x,y);
but that only works for the first and second line...
Last edited on
Oct 18, 2017 at 7:51pm UTC
Oct 18, 2017 at 11:11pm UTC
ne555
(10692)
I fail to see how that may work for the second line, as you are just reading the first one.
1
2
3
while
(inFile>>x>>y){
//...
}
that would read the whole file, you may proccess it line-by-line or store it in a std::vector for later use.
Topic archived. No new replies allowed.