03-14-2016
Select lines based on character length
Great solutions! (so simple, as usual!)
Many thanks!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Is there any way to merge two lines based on specific occurance of a character in a file.
I am having a flat file which contains multiple records.
Each row in the file should contain specified number of delimiter.
For a particular row , if the delimiter count is not matched with... (2 Replies)
Discussion started by: mohan_tuty
2 Replies
2. Shell Programming and Scripting
All,
I can't seem to find exactly what I'm looking for, and haven't had any luck patching things together.
I need to look through a file, and if the record length is not 874, then add 'E' in position 778.
Your help is greatly appreciated. (4 Replies)
Discussion started by: CutNPaste
4 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I would like to know how can I select lines of one file based on a common ID column from another file (keeping the order of the second file).
Example of file1:
ID A B C D
1-30 1 2 3
5-60 4 5 6
1-20 7 8 9
Example of file2:
ID chr pos
1-20 1 20
1-30 1 30
5-60 5 60
Desired... (2 Replies)
Discussion started by: fadista
2 Replies
4. Shell Programming and Scripting
Hello,
I use UBUNTU 12.04.
I want to write a short program using awk to select some lines in a file based on a second file.
My first file has this format with about 400,000 lines and 47 fields:
SNP1 1 12.1
SNP2 1 13.2
SNP3 1 45.2
SNP4 1 23.4
My second file has this format:
SNP2
SNP3... (1 Reply)
Discussion started by: Homa
1 Replies
5. Shell Programming and Scripting
Hi
I need to select lines from a txt file, I have got a line starting with ZMIO:MSISDN= and after a few line I have another line starting with 'MOBILE STATION ISDN NUMBER' and another one starting with 'VLR-ADDRESS' I need to copy these three lines as three different columns in a separate... (3 Replies)
Discussion started by: Tlcm sam
3 Replies
6. Shell Programming and Scripting
Hi,
I am in need of help for the two things which is to be done.
First, I have a file that has around four columns. The first column is filled with letter "A".
There are around 400 lines in the files as shown below.
A 1 5.2 3.2
A 2 0.2 4.5
A 1 2.2 2.2
A 5 2.1 ... (2 Replies)
Discussion started by: begin_shell
2 Replies
7. Shell Programming and Scripting
Hi,
I have a pipe delimeted text file where lines have been split over 2 lines and I need to join them back together. For example the file I have is similar to the following:
aaa|bbb
|ccc
ddd|eee
fff|ggg
|hhh
I ideally need to have it looking like the following
aaa|bbb|ccc
ddd|eee... (5 Replies)
Discussion started by: fuji_s
5 Replies
8. Shell Programming and Scripting
Hi,
I need help with one problem, I came across recently.
I have one input file which I need to delimit based on character length.
$ cat Input.txt
12345sda231453
asd760kjol62569
sdasw4g76gdf57
And, There is one comma separated file which mentions "start of the field" and "length... (6 Replies)
Discussion started by: Prathmesh
6 Replies
9. Shell Programming and Scripting
Good day, I am a newbie here and thanks for accepting me
I have a task to modify input data where my input data looks like
123|34567|CHINE
1|23|INDIA
34512|21|USA
104|901|INDIASee that my input has two columns with different character length but max length is 5 and minimum length is 0 which... (1 Reply)
Discussion started by: fastlearner
1 Replies
10. Shell Programming and Scripting
Hello,
I want to get the maximum value of each record separated by empty line based on the 3rd column of each row within each record?
Input:
A1 chr5D 634 7 82 707
A2 chr5D 637 6 82 713
A3 chr5D 637 5 82 713
A4 chr5D 626 1 82 704... (4 Replies)
Discussion started by: yifangt
4 Replies
LEARN ABOUT DEBIAN
html::formfu::role::element::group
HTML::FormFu::Role::Element::Group(3pm) User Contributed Perl Documentation HTML::FormFu::Role::Element::Group(3pm)
NAME
HTML::FormFu::Element::_Group - grouped form field base-class
DESCRIPTION
Base class for HTML::FormFu::Element::Checkboxgroup, HTML::FormFu::Element::Radiogroup, and HTML::FormFu::Element::Select fields.
METHODS
options
Arguments: none
Arguments: @options
---
elements:
- type: Select
name: foo
options:
- [ 01, January ]
- [ 02, February ]
- value: 03
label: March
attributes:
style: highlighted
- [ 04, April ]
If passed no arguments, it returns an arrayref of the currently set options.
Use to set the list of items in the select menu / radiogroup.
Its arguments must be an array-ref of items. Each item may be an array ref of the form "[ $value, $label ]" or a hash-ref of the form "{
value => $value, label => $label }". Each hash-ref may also have an "attributes" key.
Passing an item containing a "group" key will, for Select fields, create an optgroup. And for Radiogroup fields or Checkboxgroup fields,
create a sub-group of radiobuttons or checkboxes with a new "span" block, with the classname "subgroup".
An example of Select optgroups:
---
elements:
- type: Select
name: foo
options:
- label: "group 1"
group:
- [1a, 'item 1a']
- [1b, 'item 1b']
- label: "group 2"
group:
- [2a, 'item 2a']
- [2b, 'item 2b']
When using the hash-ref construct, the "label_xml" and "label_loc" variants of "label" are supported, as are the "value_xml" and
"value_loc" variants of "value", the "attributes_xml" variant of "attributes" and the "label_attributes_xml" variant of "label_attributes".
"container_attributes" or "container_attributes_xml" is used by HTML::FormFu::Element::Checkboxgroup and HTML::FormFu::Element::Radiogroup
for the c<span> surrounding each item's input and label. It is ignored by HTML::FormFu::Element::Select elements.
"label_attributes" / "label_attributes_xml" is used by HTML::FormFu::Element::Checkboxgroup and HTML::FormFu::Element::Radiogroup for the
c<label> tag of each item. It is ignored by HTML::FormFu::Element::Select elements.
values
Arguments: @values
---
elements:
- type: Radiogroup
name: foo
values:
- jan
- feb
- mar
- apr
A more concise alternative to "options". Use to set the list of values in the select menu / radiogroup.
Its arguments must be an array-ref of values. The labels used are the result of "ucfirst($value)".
value_range
Arguments: @values
---
elements:
- type: Select
name: foo
value_range:
- ""
- 1
- 12
Similar to "values", but the last 2 values are expanded to a range. Any preceding values are used literally, allowing the common empty
first item in select menus.
empty_first
If true, then a blank option will be inserted at the start of the option list (regardless of whether "options", "values" or "value_range"
was used to populate the options). See also "empty_first_label".
empty_first_label
empty_first_label_xml
empty_first_label_loc
If "empty_first" is true, and "empty_first_label" is set, this value will be used as the label for the first option - so only the first
option's value will be empty.
SEE ALSO
Is a sub-class of, and inherits methods from HTML::FormFu::Element::_Field, HTML::FormFu::Element
HTML::FormFu
AUTHOR
Carl Franks, "cfranks@cpan.org"
LICENSE
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-01-14 HTML::FormFu::Role::Element::Group(3pm)