10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
Hi, it's my first time in this site.
I've a file that look likes
Edges 21 82
Edges 3 22
Edges 34 12
Edges 1 24
Edges 6 2
Edges 12 22
etc. I need extract just the second and third column with the space between them. Thanks:)
Please use code tags next time for your code and data. (4 Replies)
Discussion started by: iMunk
4 Replies
3. 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
4. Shell Programming and Scripting
Hi All,
Using below command to extract text from a file
grep -E "^.{20}5004" filename.rtf >> 5004This will give all lines with text 5004 starting at position 20.
The file filename.rtf contains several rows (millions). The four characters starting from 20 position is repeating in several... (4 Replies)
Discussion started by: hsehdar
4 Replies
5. 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
6. Shell Programming and Scripting
Can Anyone tell me how to extract the second column of a xls sheet
And compare the content of each row of the column with a .h file.
xls sheet is having only one spreadsheet. (2 Replies)
Discussion started by: suvenduperl
2 Replies
7. Shell Programming and Scripting
Hi,
I need to extract last column of each row of a file (may be 'cut' should do).
And I don't know the number of last column. (2 Replies)
Discussion started by: DivyaG
2 Replies
8. Shell Programming and Scripting
Hi everybody
I have some problems with PERL programming.
I have a file with two columns, both with numeric values.
I have to extract the values > 50 from the 2nd columns and sum them among them.
The I have to sum the respective values in the first column on the same line and, at the end, I... (6 Replies)
Discussion started by: m_elena
6 Replies
9. Shell Programming and Scripting
Dear All,
I have a file name pointer.unl. It's contains the information below:
O|A|4560333089|PBS|AU1|01/04/2003|30/04/2006|D|IGCD|
O|A|4562222089|PBN|AU1|01/02/2006|31/01/2008|D|04065432|
O|A|3454d00089|PKR|AU1|01/03/2008||R|sdcdc|
I only need to extract first... (11 Replies)
Discussion started by: selamba_warrior
11 Replies
10. UNIX for Dummies Questions & Answers
I have a file containing the lines similar to the following entries:
File1.txt:
.....
-rw-r--r-- 1 root staff 4110 Aug 7 17:02 XXX_OrderNum1_date1_time1.txt
-rw-r--r-- 1 root staff 4110 Aug 7 17:02 XXX_OrderNum2_date2_time1.txt
-rw-r--r-- 1 root staff ... (3 Replies)
Discussion started by: sudheshnaiyer
3 Replies