Retrieve line from a file based on a value in specific column
Hi,
I have a file that has several values seperated by ":"
I need make a filter based on the 5th field to find countries that start with a pecific character and then retrieve the lines that match this filter.
HI,
Your help was great: awk -F":" '$5 ~ /^P/{print }' file
I would like to know what changes need to be done to this line code, so that I can put it in a shell script and call it as the example below.
example: countries that start with chacater 'P'
> country P
Result:
... (0 Replies)
I have a file which contains several lines. Sample content of the file is as below.
OK testmessage email<test@123>
NOK receivemessage email<123@test>
NOK receivemessage email(123@test123)
NOK receivemessage email<abc@test>
i would like to know by scripting will... (10 Replies)
Hello!
I need to delete one line in a file which matches one very precise instance of a string only. When searching the forum I unfortunately only found a solution which would delete each line on which a particular string occurs.
Let's assume I have a file composed of thousands of lines... (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,
I have a tab delimited text file from which I want to cut out specific columns. If the second column equals one, I want to cut out columns 1 and 5 and 6. If the second column equals two, I want to cut out columns 1 and 5 and 7. How do I go about doing that? Thanks! (4 Replies)
Suppose i have the following data :
cat file.txt
12431,123334,55353,546646,14342234,4646,35234
123123,3535,123434,132535,1234134,13535,123534
123213,545465,23434,45646,2342345,4656,31243
2355425,2134324,53425,342,35235,23434,234535
3423424,234234,65465,,2344,35436,234524,234... (7 Replies)
Hi...friends....
I want to create inventory...information for that I need to read some specific row say 2nd row from 1st 3 column and and write data with particular file used, I have some more column also but I need only 3 column data of first entry after header
I attached sample file..those... (12 Replies)
I have an xml file dumped from rrd file, that I want to "patch" so the xml file doesn't contain any blank hole in the resulting graph of the rrd file.
Here is the file.
<!-- 2015-10-12 14:00:00 WIB / 1444633200 --> <row><v> 4.0419731265e+07 </v><v> 4.5045912770e+06... (2 Replies)
In the file below I am trying to extract a specific instance of path, if the adjacent plugin": "/rundb/api/v1/plugin/49/. Thank you :).
file
"path": "/results/analysis/output/Home/Auto_user_S5-00580-4-Medexome_65_028/plugin_out/FileExporter_out.52", "plugin": "/rundb/api/v1/plugin/49/",... (8 Replies)
Discussion started by: cmccabe
8 Replies
LEARN ABOUT DEBIAN
tangram::type::set::fromone
Tangram::Type::Set::FromOne(3pm) User Contributed Perl Documentation Tangram::Type::Set::FromOne(3pm)NAME
Tangram::Type::Set::FromOne - map Set::Object using a foreign key
SYNOPSIS
use Tangram;
# or
use Tangram::Core;
use Tangram::Type::Set::FromOne;
$schema = Tangram::Schema->new(
classes => { Basket => { fields => {
iset =>
{
# long form
fruits =>
{
class => 'Fruit',
coll => 'basket',
},
# or (short form)
fruits => 'Fruit',
}
DESCRIPTION
This class maps references to Set::Object collections in an intrusive fashion. The persistent fields are grouped in a hash under the "iset"
key in the field hash.
The set may contain only objects of persistent classes. These classes must have a common persistent base class.
Tangram uses a column on the element's table to store the id of the object containing the collection.
CAUTION: the same object may not be an element of the same collection, in two different objects. This mapping may be used only for one-to-
many relationships.
The field names are passed in a hash that associates a field name with a field descriptor. The field descriptor may be either a hash or a
string. The hash uses the following fields:
* class
Mandatory field "class" specifies the class of the elements.
* aggreg
Optional field "aggreg" specifies that the elements of the collection must be removed (erased) from persistent storage along with the
containing object. The default is not to aggregate.
* back
Optional field "back" sets the name of a field that is inserted in the elements. That field acts as a demand-loaded, read-only refer-
ence to the object containing the collection.
* coll
Optional field "coll" sets the name the column containing the id of the containing object. This defaults to 'C_m', where 'C' is the
class of the containing object (after passing through the normalisation function), and 'm' is the field name.
* deep_update
Optional field "deep_update" specificies that all elements have to be updated automatically when "update" is called on the collection
object. Automatic update ensures consisitency between the Perl representation and the DBMS state, but degrades update performance so
use it with caution. The default is not to do automatic updates.
If the descriptor is a string, it is interpreted as the name of the element's class. This is equivalent to specifying only the "class"
field in the hash variant.
perl v5.8.8 2006-03-29 Tangram::Type::Set::FromOne(3pm)