пример на Python: Code: #!/usr/bin/python # -*- coding: cp1251 -*- with open("source.txt") as inpt: with open("out.txt", "a") as out: for line in inpt: line = line.replace("\r", "").replace("\n", "") check_line = line.replace(" ", "") if check_line.isdigit(): pass else: line = line.split(" ") for word in line: word = word.strip() if not word.isdigit(): out.write(word+" ") out.write("\n") #(c) :D source.txt: Code: 1 download 1 750 000 000 27 266 2 mcafee download free trial 1 960 000 15 631 14 295 4 download music 298 000 000 11 141 5 bootleg movie download 1 360 000 8 941 6 golden casino download http 2 290 000 8 842 7 latest dota 6.45ai map download 2 470 7 493 на выходе в out.txt: Code: download mcafee download free trial download music bootleg movie download golden casino download http latest dota 6.45ai map download
regex PHP: using System; using System.Text.RegularExpressions; namespace ConsoleApplication1 { class Program { private static string str = "1 download 1 750 000 000 27 266" + "2 mcafee download free trial 1 960 000 15 631 14 295" + "4 download music 298 000 000 11 141" + "5 bootleg movie download 1 360 000 8 941" + "6 golden casino download http 2 290 000 8 842" + "7 latest dota 6.45ai map download 2 470 7 493"; static void Main() { var r = new Regex(@"[^0-9]"); foreach (Match m in r.Matches(str)) { Console.WriteLine(m.Value); } Console.ReadLine(); } } } вся задача сводится к использованию регулярных выражений p.s. подфикси свою грамматику русского языка...