Help with alias, variables and $read. - 11/04/14 08:10 PM
I'm currently using an alias to single out some lines from a textfile created. I succeeded in printing the entire line which was over 25.000 letters long by using the $noHTML alias. - Now, my question is: How do I filter out a single word from the variable that contains all the text since $1- will mean what I wrote after the /alias.
Will I have to use a regex to find what I'm looking for right now and then regsubex the stuff I don't want which is around it? Or can I create another alias which will return $1- in %t and a specified amount of letters afterwards? - I'm clueless.
Relevant info
Code:Echo:
Note: This line is actually 25000 letters long, only reduced by $noHTML
Will I have to use a regex to find what I'm looking for right now and then regsubex the stuff I don't want which is around it? Or can I create another alias which will return $1- in %t and a specified amount of letters afterwards? - I'm clueless.
Relevant info
Code:
Code:
alias test { echo -ag Searching for $1- if ($read(test.txt,nw,* $+ $1- $+ *)) { echo -ag Found $1-, it was at $readn var %t $noHTML($read(test.txt, $+ $readn)) echo -ag %t } }
Quote:
Searching for Win Rate
Found Win Rate, it was at 39
window.showAds = trueDOTABUFFHeroesItemsMatchesPlayersTeamsBlogForumsPlusSign in with SteamNillenLast MatchApr 11, 2014 16:10 UTCRecord909 - 913Win Rate49.89%OverviewMatchesHeroesItemsRecordsMatchupsTrendsPlayed With MeYou need to enable the "Share Match History" setting in the Dota 2 client in order to have your statistics appear on Dotabuff. Learn Moregoogletag.cmd.push(function() googletag.display('div-gpt-ad-1396029281698-0'); });Most Played HeroesAll TimeHeroMatches PlayedWin RateKDA RatioRubick12650.79%2.10
Found Win Rate, it was at 39
window.showAds = trueDOTABUFFHeroesItemsMatchesPlayersTeamsBlogForumsPlusSign in with SteamNillenLast MatchApr 11, 2014 16:10 UTCRecord909 - 913Win Rate49.89%OverviewMatchesHeroesItemsRecordsMatchupsTrendsPlayed With MeYou need to enable the "Share Match History" setting in the Dota 2 client in order to have your statistics appear on Dotabuff. Learn Moregoogletag.cmd.push(function() googletag.display('div-gpt-ad-1396029281698-0'); });Most Played HeroesAll TimeHeroMatches PlayedWin RateKDA RatioRubick12650.79%2.10
Note: This line is actually 25000 letters long, only reduced by $noHTML
Code:
alias noHTML return $regsubex($1, /<[^>]+(?:>|$)|^[^<>]+>/g, $null)