GAM Posted February 20, 2008 Share Posted February 20, 2008 Hi, How can I search a string from a txt file separated by the char "|"? .....I will give an example, SourceFile.Txt has the following info abqwec1|Check1|StandardTest1 hbqwec2|Check2|StandardTest2 rbqweqc3|Check3|StandardTest3 3bqwetc4|Check4|StandardTest4 ertybc5|Check5|StandardTest5 in the above file, the first line comprises of three strings abqwec1, Check1 and StandardTest1 each separated by the char "|". How can I find the strings in order, I mean, find the first string in the first line and then the second string in the first line and the third string in the first line NOW After this, find the first string in the second line and then second string in the second line and so on and so forth till the end of the file.? Can any one please look into this and send me an answer how to implement this is AUTOIT? Its urgent!!! Neil Link to comment Share on other sites More sharing options...
weaponx Posted February 20, 2008 Share Posted February 20, 2008 I'm not sure what you mean by "find". You can do this easily with _FileListToArray, StringSplit, and StringInStr in less than 10 lines of code. Link to comment Share on other sites More sharing options...
randallc Posted February 20, 2008 Share Posted February 20, 2008 I'm not sure what you mean by "find". You can do this easily with _FileListToArray, StringSplit, and StringInStr in less than 10 lines of code.hi, Like so? #include<array.au3> Local $aNow[5] = ["abqwec1|Check1|StandardTest1", "hbqwec2|Check2|StandardTest2", "rbqweqc3|Check3|StandardTest3", "3bqwetc4|Check4|StandardTest4", "ertybc5|Check5|StandardTest5"] Local $aNew[15],$k For $i = 0 To UBound($aNow) - 1 local $aRow=StringSplit($aNow[$i],"|") For $j = 1 To UBound($aRow) - 1 $aNew[$k ] =$aRow[$j] $k+=1 Next Next _ArrayDisplay($aNew, "$aNew" Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
GAM Posted February 21, 2008 Author Share Posted February 21, 2008 Thanks a lot for all ur answers. Neil Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now