---------- Post updated at 11:57 AM ---------- Previous update was at 11:57 AM ----------
Quote:
Originally Posted by Corona688
I'm not sure what you're saying here. strstr hunts for an instance of one string inside another, precisely what you want. If you want to check for two strings, call it again on the other string, and skip if either match.
strstr() would check to see if the substring str1 is part of string str2, as I read in the man pages.
so, to use strstr() you need to know str2.
In my case, str2 is a list of hundreds of files that I loop over one by one.
All I need is to skip the string if it has any of the 2 substrings I mentioned above.
Here is the code:
Please notice that it is not a 100% C++, but this is because the ROOT system has some differences. Yet, all C++ codes work with it.
TFile and other strange words are classes from the framework I use.
You should be able to do:
However, looking at your code, you always concatenate "bdt" or "nn" to "pre_ti_data_", why not just check if(var == bdt || var ==nn"), if so then continue there, rather than doing all the concatentation then the check??[COLOR="#738fbf"]
that's because pre_ti_????? is a name of set of files among other sets.
I am dealing with 1000s of files! that's while I keep losing track of where I am
Hi,
I have a process that generates strings.
I would like to check each string and search for substring which contains the letter 'E' surrounded by numbers (both sides of the letter 'E').
few examples:
AA4E7012A2 - contains E surrounded by numbers
FE18274012 - does not contain E... (3 Replies)
I want to check if the string has the substring in IF condition then process...
i tried below but not working
if ];
then
.............
field can be "reserved1" ....reservedn / fillspaces1 ... fillspacesn (4 Replies)
hi everyone
I have a C program where I have a line and I want to check if the line contains a string.The line is stored in a buffer.How can I do that?
Can I consider the whole line as a string and check for a substring?And if so what's the most efficient way to achieve it? (1 Reply)
Hi All,
I have a ouput string likes 'u8wos' or 'u10acsd' or somthing else 'u{number}{any characters}'and I want to get the number behind the letter 'u' by bash shell.
Thanks
Damon (11 Replies)
Hi,
I hav a string lets say aa.txt:bb:txt
length of the string can vary.. I have to keep the token inside a array and the delimiter is : plz send me the code (2 Replies)
Hi
I use the below cmd to get the list of files that are modified than <temp> file in the <path> diretory
cmd:find <path> -name '*.zip' -type f -newer <temp> -print
i am getting all the list of files that are new or modified, with abs path, i want to copy all of these files to a... (3 Replies)
I need to check the occurrence of one string within another.
code
********************
if ;then do something done
********************
Thanks (7 Replies)
This is probably pretty simple butI'm not sure how to best go about it.
If I have
FILE="myBigLongFileName_1.xls"
FILE_PREFIX=`echo $FILE| cut -d"." -f1`
# that gives "myBigLongFileName_1"
All i want to do now is chop the "_1" from the end of $FILE_PREFIX
Any ideas anyone? (3 Replies)