You can "multiply" regexp parts with the "\{...\}" operator. For instance: "x" means a single "x", but "x\{3\}" means "three x" and would be equivalent to "xxx". But it comes even better, the operator can be given two values, which will define a range: "x\{1,3\}" means "one, two or three x". Instead of "x" one could even put a complicated regexp in braces.
Now your problem: a single field in a comma-separated file would be matched by: "[^,]*,". You have already figured that out. Now we try to match something in the 11th field. This is: ten fields, followed by the field on question:
This matches "xxx" in the eleventh field. You see you could shorten and simplify your regexp considerably using this device. Your search for "more than 999.9 in the 10th, 11th or 12th field" could look like this:
9-11 fields, followed by a number of at least 4 digits.
We have an access log where column 8 displays the time in seconds like below:
Tj8nQAoNgwsAABov9cIAAAFL - 10.13.131.80 - - (0) - "GET /aaaaa/bbbb/bbbb
where column 8 is printed (0). We are trying to find how many entries are there that has column 8 greater than 0.
Remember $8 is (0) and not... (5 Replies)
my files are as follows
fileA sepearated by tab /t
00 lieferungen
00 attractiop
01 done
02 forness
03 rasp
04 alwaysisng
04 funny
05 done1
fileB
funnymou120112
funnymou234470
mou3raspnhdhv
rddfgmoudone1438748
so all those record which are greater than 3 and which are not... (4 Replies)
Hello,
:wall:
I have a 12 column csv file. I wish to delete the entire line if column 7 = hello and column 12 = goodbye. I have tried everything that I can find in all of my ref books.
I know this does not work
/^*,*,*,*,*,*,"hello",*,*,*,*,"goodbye"/d
Any ideas?
Thanks
Please... (2 Replies)
Hi all,
I am new to shell script.I need your help to write a shell script.
I need to write a shell script to extract data from a .csv file where columns are ',' separated.
The file has 5 columns having values say column 1,column 2.....column 5 as below along with their valuesm.... (3 Replies)
Hi List,
I have a chunk of data like so:
User Account Control:
User Account Control:
User Account Control:
User Account Control:
Disabled
User Account Control:
User Account Control:
User Account Control:
Disabled
User Account Control:
User Account Control:
... (3 Replies)
Hi, I am newbie in shell script.
I need your help to solve my problem.
Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file.
File1:
SourceFile,DateTimeOriginal
/home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
I am running an ISQL command on Sybase DB and getting output of a query in an CSV file.
The issue is that all the data comes in to the same column, i want them to be separated in different columns.
SQL_COMMAND=command.sql
file=file.txt
formatFile=formatFile.txt
report=report.csv
echo... (1 Reply)
I have two csv files of different sizes. The output file needs to have file1 contents on top of file2 contents where file2 col1 is >= to file1 col1, and file2 col1(same value) is < file1 col1 (next value). So basically, some file2 rows will be matched to the same file1 row because it is the closet... (7 Replies)
Adding new column data in csv from UNIX
Hi I need to add new column data daily to existing csv file. Please assist
7/11 7/10 7/9 7/8
space 10 GB 20 GB
I was able to generate current day's data in csv but unable to add the previous 30 days data to the same csv
Please use code tags,... (2 Replies)
Discussion started by: archana25
2 Replies
LEARN ABOUT OSX
ppi::token::regexp::match
PPI::Token::Regexp::Match(3) User Contributed Perl Documentation PPI::Token::Regexp::Match(3)NAME
PPI::Token::Regexp::Match - A standard pattern match regex
INHERITANCE
PPI::Token::Regexp::Match
isa PPI::Token::Regexp
isa PPI::Token
isa PPI::Element
SYNOPSIS
$text =~ m/match regexp/;
$text =~ /match regexp/;
DESCRIPTION
A "PPI::Token::Regexp::Match" object represents a single match regular expression. Just to be doubly clear, here are things that are and
aren't considered a match regexp.
# Is a match regexp
/This is a match regexp/;
m/Old McDonald had a farm/eieio;
# These are NOT match regexp
qr/This is a regexp quote-like operator/;
s/This is a/replace regexp/;
METHODS
There are no methods available for "PPI::Token::Regexp::Match" beyond those provided by the parent PPI::Token::Regexp, PPI::Token and
PPI::Element classes.
Got any ideas for methods? Submit a report to rt.cpan.org!
SUPPORT
See the support section in the main module.
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Copyright 2001 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.16.2 2011-02-25 PPI::Token::Regexp::Match(3)