10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In the below perl I am trying to extract and print the values AF1=, the GT value, and F or QUAL diveded by 33 (rounded to the nearest whole #). The GT value is at the end after the GT:PL so all the possibilities are read into a hash h, then depending on the value that is in the line the... (1 Reply)
Discussion started by: cmccabe
1 Replies
2. Shell Programming and Scripting
Hi,
I want to extract first column from a file and redirect the output to another file in perl.
I am able to do this from command line by executing below commands.
perl -anle 'print $F' Input.dat > Output.dat
perl -ne '@F = split("\t", $_); print "$F\n";' Input.dat > Output.dat
perl -anE... (7 Replies)
Discussion started by: Neethu
7 Replies
3. Shell Programming and Scripting
Hello friends,
I have a text file with many columns (no. columns vary from row to row) separated by space. I need to collect all the values from 18th column to the end from each line and group them as pairs and then numbering like below..
1. 18th-col-value 19th-col-value 2. 20th-col-value ... (5 Replies)
Discussion started by: prvnrk
5 Replies
4. Shell Programming and Scripting
Hi,
I am trying with the below Perl one-liner using regular expression to extract the first and second column of a text file:
perl -p -e "s/\s*(\w+).*/$1/"
perl -p -e "s/\s*.+\s(.+)\s*/$1\n/"
whereas the text file's data looks like:
Error: terminated 2233
Warning: reboot 3434
Warning:... (3 Replies)
Discussion started by: royalibrahim
3 Replies
5. Shell Programming and Scripting
Hi Guys,
I am stuck in a problem.
I have a variable in Perl script which has value for example
X=a-b-c;
Now, I want to extract a b c separately into different 3 variables. I know this can be done in shell using awk but Perl behaves a bit different.
Can anybody help me on this please?... (3 Replies)
Discussion started by: prashant2507198
3 Replies
6. Shell Programming and Scripting
Hello Gurus
I have a source file which has the first line as header and the rest are the records
I need to extract the first column from the second line to extract a value
I/P
... (7 Replies)
Discussion started by: Pratik4891
7 Replies
7. Shell Programming and Scripting
Hello,
I have 2 columns (1st column has multiple entries but the corresponding values in the column 2 may be the same or different.) however I want to extract unique values for each entry in column 1 by assigning the max value from column 2
SDF4 -0.211654
SDF4 0.978068
... (1 Reply)
Discussion started by: Diya123
1 Replies
8. UNIX for Dummies Questions & Answers
Hi everyone,
i am new to perl programming, i have a problem in extracting single column from csv file. the column is the 20th column,
please help me..
at present i use this code
#!C:/perl/bin
use warnings;
use strict;
my $file1 = $ARGV;
open FILE1, "<$file1"
or die "Can't... (13 Replies)
Discussion started by: kvth
13 Replies
9. Shell Programming and Scripting
Hello,
I have parsed an xml file using perl to get the hash values and the output looks like this
$VAR1 = {
'RT' => {
'List' => {
'String' => ... (1 Reply)
Discussion started by: userscript
1 Replies
10. Shell Programming and Scripting
Hi,
I am new to unix and I need help in solving below mentioned issue, really appreciate ur help.
I have a file
sam, john, 2324, 07142007
tom, thomson, 2343, 07142007
john, scott, 2478, 07142007
its a comma delimited file, I need to extract the last column from each line and this... (4 Replies)
Discussion started by: vukkusila
4 Replies