I'm writting a script that will get the logical volumes from a volume group and check for mirroring. I'm using a while read line command. I need to be able to count the columns for the output and if it is <= 3 save the logical volume to a file and if it is > 3 continue. How do I capture the number of collumns in the line? Here is what I have;
NOTE: lslv -m will display LP numbers (all of them for the lv) sample output below of non-mirrored logical volume
Last edited by radoulov; 03-01-2010 at 11:52 AM..
Reason: Please use code tags!
Hi All,
Consider the file with following lines:
1,2,3,4
1,2,3,
5,6,7,7,8,9
1
I need to get the count of minimum columns per line. i.e. in above case, it should come out to be 1 since the last line only has 1 column.
I tried following code:
minCount = 0
wordCountPerLine = 0... (12 Replies)
Hi,
I have a file where i have dump of a DB. it has all the columns and rows inside that. I wanted to extract the columns and number of columns from that dump.
Any suggestions will be helpful.
Thanks (1 Reply)
hi I am very new to shell scripting. i wanted to achieve this..
Col1 Col2 Col3 Col4
aa 23 bb 32
aa 34 bb 12
aa 45 bb 345
kk 20 ss 50
kk 30 ss 50
tt 10 vv 50
Desired output is
Col1 Col2 Col3 Col4 Difference Count
aa 23 bb ... (1 Reply)
Hi All,
My Input.txt should have always 4 columns in some cases i may not get all the 4columns data.
My requirement is if columns as not equal to 4 then append new column delimiter.
Input.txt
A,1,2
B,1,2,3
C,1
Desired output should be in below format
Output.txt
A,1,2,... (3 Replies)
Hi. I am not sure the title gives an optimal description of what I want to do.
I have several text files that contain data in many columns. All the files are organized the same way, but the data in the columns might differ. I want to count the number of times data occur in specific columns,... (0 Replies)
Hi everyone,
I have a file result.txt with records as following and another file mirna.txt with a list of miRNAs e.g. miR22, miR123, miR13 etc.
Gene Transcript miRNA
Gar Nm_111233 miR22
Gar Nm_123440 miR22
Gar Nm_129939 miR22
Hel Nm_233900 miR13
Hel ... (6 Replies)
I have this structure:
col1 col2 col3 col4 col5
27 xxx 38 aaa ttt
2 xxx 38 aaa yyy
1 xxx 38 aaa yyy
I need to collapse duplicate lines ignoring column 1 and add values of duplicate lines (col1) so it will look like this:
col1 col2 col3 col4 col5
27 xxx 38 aaa ttt ... (3 Replies)
The file is similar to the attached.
Thousands of columns, delimiter is tab, with many columns containing free text and space separated.
I want to get the count of columns with non-empty entries.
eg.Col1=10, Col6=5, Col8=1
awk preferred (7 Replies)
Discussion started by: genehunter
7 Replies
LEARN ABOUT OSX
vgdisplay
VGDISPLAY(8) System Manager's Manual VGDISPLAY(8)NAME
vgdisplay - display attributes of volume groups
SYNOPSIS
vgdisplay [-A|--activevolumegroups] [-c|--colon|-s|--short|-v|--verbose] [-d|--debug] [-h|--help] [--ignorelockingfailure] [--nosuffix]
[-P|--partial] [--unitshHbBsSkKmMgGtTpPeE] [--version] [VolumeGroupName[VolumeGroupName...]]
vgdisplay --columns | -C [--aligned][-d|--debug][-h|-?|--help] [--ignorelockingfailure][--noheadings][--nosuffix]
[-o|--options[+]Field[,Field]] [-O|--sort[+|-]Key1[,[+|-]Key2[,...]]] [-P|--partial] [--separatorSeparator] [--unbuffered] [--unitshHbB-
sSkKmMgGtTpPeE] [-v|--verbose] [--version] [VolumeGroupName[VolumeGroupName...]]
DESCRIPTION
vgdisplay allows you to see the attributes of VolumeGroupName (or all volume groups if none is given) with it's physical and logical vol-
umes and their sizes etc.
vgs (8) is an alternative that provides the same information in the style of ps (1).
OPTIONS
See lvm for common options and vgs for options given with --columns.
-A, --activevolumegroups
Only select the active volume groups.
-c, --colon
Generate colon separated output for easier parsing in scripts or programs. N.B. vgs (8) provides considerably more control over the
output.
The values are:
1 volume group name
2 volume group access
3 volume group status
4 internal volume group number
5 maximum number of logical volumes
6 current number of logical volumes
7 open count of all logical volumes in this volume group
8 maximum logical volume size
9 maximum number of physical volumes
10 current number of physical volumes
11 actual number of physical volumes
12 size of volume group in kilobytes
13 physical extent size
14 total number of physical extents for this volume group
15 allocated number of physical extents for this volume group
16 free number of physical extents for this volume group
17 uuid of volume group
-s, --short
Give a short listing showing the existence of volume groups.
-v, --verbose
Display verbose information containing long listings of physical and logical volumes. If given twice, also display verbose runtime
information of vgdisplay's activities.
--version
Display version and exit successfully.
--columns|-C
Display output in columns, the equivalent of vgs. Options listed are the same as options given in vgs (8).
SEE ALSO lvm(8), vgs(8), pvcreate(8), vgcreate(8), lvcreate(8)Sistina Software UK LVM TOOLS 2.02.95(2) (2012-03-06) VGDISPLAY(8)