| | |
how can i Search in text files and copy the characters
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2009
Posts: 2
Reputation:
Solved Threads: 0
I have a text file with something like this in it:
>ENSG00321 Gene_ch19 . . . .
AATAGCGGTTAACATATTAATTAAACTAATGTATAGATATTATCCGCTTCCAGATTTATTATTTTGTAAA
ATAGGCACAGTTCTTATCTGGTGTCACTTTATGCTTTTTTAATAGACGCCCAGCTCTACTCATGGCCAAG
.
.
>ENSG00531 Gene_ch5 . . . .
AAAGAAGCGTAGGCCCGCCATGCAGCGTAAAAAGGATAATGCGGAGCAGCGGTCCCCAAAGACTGATTTA
TCAAAACTGTTTTCGCAGCAATTAACACACCCACCGACCAGTAACACCGCTGCAAGCAAGGCCACGGGCA
.
.
I have some headers like (ENSG00321) too.
I want to search in text files with header and then get characters(AGCT, characters line start from below of the header line) from 5 to 100 of that header and copy to a new text file.
How can I programming this? In MATLAB or PERL or C++.
>ENSG00321 Gene_ch19 . . . .
AATAGCGGTTAACATATTAATTAAACTAATGTATAGATATTATCCGCTTCCAGATTTATTATTTTGTAAA
ATAGGCACAGTTCTTATCTGGTGTCACTTTATGCTTTTTTAATAGACGCCCAGCTCTACTCATGGCCAAG
.
.
>ENSG00531 Gene_ch5 . . . .
AAAGAAGCGTAGGCCCGCCATGCAGCGTAAAAAGGATAATGCGGAGCAGCGGTCCCCAAAGACTGATTTA
TCAAAACTGTTTTCGCAGCAATTAACACACCCACCGACCAGTAACACCGCTGCAAGCAAGGCCACGGGCA
.
.
I have some headers like (ENSG00321) too.
I want to search in text files with header and then get characters(AGCT, characters line start from below of the header line) from 5 to 100 of that header and copy to a new text file.
How can I programming this? In MATLAB or PERL or C++.
Last edited by vahiddani; May 28th, 2009 at 10:37 am.
•
•
Join Date: May 2009
Posts: 2
Reputation:
Solved Threads: 0
not always from 5th character. it can be different. i want find Header and then read characters from special character like 5th or 41th or etc and then read special number of characters start from 5th(ex, 100 or 102 or etc) and then copy and write them to another file. I have the address of headers and start character, and number of characters for each headers that must be read and copy from start character.
like this:
5th char "start to read 112 character after 5th character" so, end of string that will be copy must be 117th character.
Also there are a lot of headers and their characters in text file. i have the address of headers and their characters, that should be copy.
like this:
5th char "start to read 112 character after 5th character" so, end of string that will be copy must be 117th character.
Also there are a lot of headers and their characters in text file. i have the address of headers and their characters, that should be copy.
Last edited by vahiddani; May 28th, 2009 at 11:37 am.
![]() |
Similar Threads
- Program to search text files in a folder (Java)
- searching for keywords in multiple text files (C++)
- C++ Extracting data from text files (C++)
- Analysing text files to obtain statistics on their content (Perl)
- Making arrays from text files (VB.NET)
Other Threads in the C++ Forum
- Previous Thread: appending numbers to a name
- Next Thread: PLZ someone tell me what is wrong with my program!
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll download dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph gui homeworkhelp iamthwee ifstream image input int java lib library list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets





