Answer by Sergiy Kolodyazhnyy for Extract info from file
Python solution#!/usr/bin/env pythonimport re,syswith open(sys.argv[1]) as fd: for line in fd: pattern=[ x for x in re.split('\|\|\||;',line) if 'CSQ' in x] if pattern:...
View ArticleAnswer by kos for Extract info from file
Using Perl:perl -F'\|\|\|' -lane '$, = "\t"; @f = split(/;|\|/, $F[1]); shift(@f); splice(@f, 5); print(@f)' file-F'\|\|\|': sets the input field separator to |||;-l: enables automatic line-ending...
View ArticleAnswer by Wayne_Yux for Extract info from file
This should work for you:cut -d"|" -f4,5,6,7,8 filename.txt | sed 's/;//g' | sed 's/|/\t/g'Example:$ echo "2 41620 . T G 100 PASS...
View ArticleAnswer by heemayl for Extract info from file
Let's use sed:sed -r 's/.*\|\|\|;(CSQ[^|]+)\|([^|]+)\|([^|]+)\|([^|]+)\|([^|]+)\|.*/\1\t\2\t\3\t\4\t\5/' file.txtpython is not fast at manipulating very large file, this would be much faster than...
View ArticleExtract info from file
Is there an efficient way to parse a file like:2 41620 . T G 100 PASS...
View Article
More Pages to Explore .....