I would like it to add on a different integer to the end
So do that. As you haven't shown us any code or data what further advice are you expecting? What is the problem you are having implementing the "search and replace script"? What have you tried?
True laziness is hard work
| [reply] |
The substitution that you will need is s/\bundefined\b/"undefined" . ++$count/eg.
perlop has instructions for how to use such substitutions (look for "s/PATTERN/REPLACEMENT"), and perlrun documents the -p and -e flags which are likely to prove very useful for you. | [reply] [d/l] |
From 'rs#####' I suspect you're dealing with biology-related stuff, what is the file format if any, better still, show how the template looks like and how you want your output looking like, show your attempts, and then it will only be possible to provide you better guidance. The key is, clearly worded question with efforts displayed yield more accurate responses from the generous monks out here..
Go through How do I post a question effectively? and Perl and Bioinformatics ...
Excellence is an Endeavor of Persistence.
A Year-Old Monk :D .
| [reply] [d/l] |
If the ID is missing, then maybe you should not insert it into your table. I presume you are talking about a database here ...are you? Another alternative would be to add an auto incremented column and let your database insert the unique IDs for you.
| [reply] [d/l] [select] |
While the ID is missing, each entry is still important to keep in the file since it is a reference file associated with another data file. Thus, the analysis program will read the undefined ID as missing, but it still needs it there to keep the two files consistent. I have the reference file as a text file right now with tab delimited formate, and would like to know if there is a simple solution to making each rsundefined unique as that would solve the problem by itself
| [reply] |