r/LabVIEW • u/[deleted] • Sep 15 '15
Help with a Labview program?
So I have a project in my engineering class where I have to create a program that reads rna sequences in a text file, identify the palindromes of length X or greater (X determined by user input), and either (a) strip the palindromes from the original text file by writing a new, "clean" text file, or (b) writing the list of found palindromes to a new text file, each separated by a comma.
My progress is the ability to test for a palindrome based on user input, but I don't know how to find it by reading a text file and for different lengths
can anybody give a tip or advice? Thanks!
1
Sep 15 '15
Is the RNA data in the text file comma-delimited? What's the formatting? Is it one long string? Rows of length N? Posting an example of the data you have to work with would be helpful.
1
Sep 15 '15
It's one long string. My professor didn't give any example but he expects the program to be able to work for any given sequence
1
Sep 15 '15
Well, I suppose that makes things a bit easier in that you don't have to worry about formatting.
Just be aware that GAATTC != gaattc, so when you read the string from the file, you'll want to use the 'To Upper Case' or 'To Lower Case' string functions to ensure that you're making an apples-to-apples comparison.
Dealing with strings can be somewhat annoying, but look at the functions available on the String palette and you'll find a lot of options for searching and matching. as /u/fuckingpewpew pointed out, the Example Finder (Help -> Find Examples...) has loads of good stuff to use as a starting point.
2
u/fuckingpewpew Sep 15 '15
One of the palettes deals with file IO. Checkout some of the functions in it. You can probably use an example in the example finder as a starting point.