noname 2 Posted May 20, 2015 Report Share Posted May 20, 2015 what i want to do is get what ever line from a text file i know how to use list to get it but i want to use regex and text file only i have a text file that has numbers like this in it 109288078718151326541940572150801504110000963918833131105080100000190745991655229634100003094469917 i want to set numbers in a variable and i want to get it from a text line i can get the first line like this now set(#row1,$find regular expression($list from file("c:\\numbers.txt"),"\\A.*"),"Global")set(#test,"whats up {#row1} my number ","Global") this is how i want it whats up 1092880787 my number i can also get other lines too like this set(#row5,$find regular expression($list from file("C:\\numbers.txt"),"(.*)(?=(\n.*)\{5\}$)"),"Global")set(#test,"whats up {#row5} my number ","Global") but that breaks the line and my output looks like this whats up 100009639188331my number is there a command like\A.*so i can get the second, third, forth and so on Quote Link to post Share on other sites
HelloInsomnia 1103 Posted May 20, 2015 Report Share Posted May 20, 2015 Why does it have to be regex is there other stuff in the file besides numbers? Quote Link to post Share on other sites
noname 2 Posted May 20, 2015 Author Report Share Posted May 20, 2015 no only numbers, if there is something else besides regex thats fine but i dont want to add it to a table or to a list just want to pull it from the text file if there was a way to delete the first line after getting it than that would work too Quote Link to post Share on other sites
HelloInsomnia 1103 Posted May 20, 2015 Report Share Posted May 20, 2015 You can use this plugin to read part of a file: http://www.ubotstudio.com/forum/index.php?/topic/15579-free-plugin-advanced-file-clipboardhandle-big-lists-in-text-files-and-more/ Just read one line at a time I guess. Why don't you just want to use a list though? That is normally the right way to do it. 1 Quote Link to post Share on other sites
noname 2 Posted May 20, 2015 Author Report Share Posted May 20, 2015 thanks i think that should work, but the reason why i dont wan to do a list or a table is because ive been having some problems with it in multithread eaiser to write the files to disk with a random file name and read it from there Thanks Quote Link to post Share on other sites
HelloInsomnia 1103 Posted May 20, 2015 Report Share Posted May 20, 2015 What kind of problems? I may be able to help you out. Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted May 20, 2015 Report Share Posted May 20, 2015 here is an alternative save to file("{$special folder("Desktop")}\\test-read.txt", "109288078718151326541940572150801504110000963918833131105080100000190745991655229634100003094469917")alert($list item($list from text($read file("{$special folder("Desktop")}\\test-read.txt"), $new line), 4)) CD 1 Quote Link to post Share on other sites
Black Automation 20 Posted June 5, 2015 Report Share Posted June 5, 2015 why not add the txt file to a list, and then use "set list position" to grab data?why must you use ragex inside a txt file? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.