Sponsored Content
Top Forums Shell Programming and Scripting cut -d with more than 1 delimiter? Post 302537839 by neutronscott on Sunday 10th of July 2011 04:02:29 PM
Old 07-10-2011
Code:
root@wrtu54g:~# vnstat --dumpdb | awk -F';' '$2 == hr && $1 == "h" { print $4 FS $5 }' hr=`date +%H`
128570;4814


Last edited by neutronscott; 07-10-2011 at 06:03 PM.. Reason: fixed it
This User Gave Thanks to neutronscott For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

\r as delimiter in cut

I need to use \r as a delimiter in the -d option of the cut comand . Any help ? Thanks in advance . SD (5 Replies)
Discussion started by: shweta_d
5 Replies

2. UNIX for Advanced & Expert Users

Cut date using y hat as delimiter

QUESTION: How can I cut out the date from just the first line and reformat it to 31-Jul-2007? I'll restate the question at the bottom again... DESCRIPTION: I need to cut a date out of a file - an example of the date's format in the file is 2007-07-31. It's in the 5th field and is separated... (1 Reply)
Discussion started by: tekster757
1 Replies

3. Shell Programming and Scripting

Cut Number which appear before a delimiter

Hi All, How can i use the cut option to only output the number of rows, which is 2 is this case ? Pls note that the number of digit before the delimiter ":" is always varying. $ grep -n uuu xxx 2:** xxx yyy gg 44 tt uuu 2007 $ (2 Replies)
Discussion started by: Raynon
2 Replies

4. UNIX for Advanced & Expert Users

use a word as a delimiter with cut

Is there a way to use a word as a delimiter with cut? Or is there a way to use sed or awk with a word as a delimiter? I don't care which program I use for a delimiter I just want to use a word as a delimiter. (2 Replies)
Discussion started by: cokedude
2 Replies

5. Shell Programming and Scripting

Cut columns with delimiter

HI, I have a file like below "103865","103835","Zming","","Zhu","103965","Sunnyvale","US", "116228","116227","Morlla","","Kowalski","113228","Paese "(Treviso)""IT" I want to validate the 7th column which is below. "Sunnyvale" "Paese In the above 7th column Paese is not ended with... (9 Replies)
Discussion started by: Krrishv
9 Replies

6. Shell Programming and Scripting

how to cut all string after the last delimiter?

hi all, suppose a string: abc/def/ghi/jkl/mn.txt and i want to get the file name without the path. however, different files have different paths, therefore the number of delimiter is uncertain. thanks so much! (3 Replies)
Discussion started by: sunnydanniel
3 Replies

7. Shell Programming and Scripting

How to cut by delimiter, and delimiter can be anything except numbers?

Hi all, I have a number of strings like below: //mnt/autocor/43°13'(33")W/ and i'm trying to get the numbers in this string, for example 431333 please help thanks ahead (14 Replies)
Discussion started by: sunnydanniel
14 Replies

8. Shell Programming and Scripting

cut with delimiter respect text

Hi, Can someone help me to get the shortest command Input file ========= I|know|"english|french" It|can|have|four|delimiters Desired output =========== "english|french" have If I use cut -d "|" -f3 , i am getting "english as 3rd field.But I would like to get the whole text in... (2 Replies)
Discussion started by: anandapani
2 Replies

9. Shell Programming and Scripting

cut delimiter and save

i have list of names in a text file and I wanted to delete the commas en every line. for example: inside the text is a list of names in it with commas after each line. I wanted to delete these commas. which command must I execute for this? unix, dale, shawn, aaron, (4 Replies)
Discussion started by: garfish
4 Replies

10. Shell Programming and Scripting

Cut cmd with delimiter as |#|

Hi All- We have a file data as below with delimiter as |#| 10|#|20|#|ABC 13|#|23|#|PBC If I want to cut the 2nd field out of this, below command is not working as multiple pipe is causing an issue , it seems cut -f2 -d"|#|" <file_name> can you please help to provide the correct command... (7 Replies)
Discussion started by: sureshg_sampat
7 Replies
VNSTAT.CONF(5)							   User Manuals 						    VNSTAT.CONF(5)

NAME
vnstat.conf - vnStat configuration file SYNOPSIS
/etc/vnstat.conf DESCRIPTION
vnstat(1), vnstati(1) and vnstatd(1) all use the same configuration file for storing configuration data. Some of the settings are common for all three programs. The file contains keyword-argument pairs, one per line. Lines starting with '#' and empty lines are interpreted as comments and not processed. Arguments may optionally be enclosed in double quotes (") in order to represent arguments containing spaces. Arguments can be padded with spaces or tabulator characters. A hardcoded default value will be used if a keyword can't be found from the configuration file. COMMON KEYWORDS
BootVariation Time in seconds how much the boot time reported by system kernel can variate between updates. CheckDiskSpace Enable or disable the checking of at least some free disk space before a database write. 1 = enabled, 0 = disabled. DatabaseDir Specifies the directory where interface databases are to be stored. A full path must be given and a leading '/' isn't required. DayFormat, MonthFormat, TopFormat Formatting of date in available outputs. Uses the same format as date(1). (vnstat and vnstati only) Interface Default interface used when no other interface is specified on the command line. (vnstat and vnstati only) Locale Locale setting to be used for prints. This replaces the LC_ALL environment variable. Set to "-" in order to use the system default value. (vnstat and vnstati only) MaxBandwidth Maximum bandwidth for all interfaces. If the counted traffic exceeds the given value then the data is assumed to be invalid and rejected. Set to 0 in order to disable the feature. (vnstat and vnstatd only) MaxBW Same as MaxBandwidth but can be used for setting individual limits for selected interfaces. The name of the interface is specified directly after the MaxBW keyword without spaces. For example MaxBWeth0 for eth0 and MaxBWppp0 for ppp0. (vnstat and vnstatd only) MonthRotate Day of month that months are expected to change. Usually set to 1 but can be set to alternative values for example for tracking monthly billed traffic where the billing period doesn't start on the first day. (vnstat and vnstatd only) OutputStyle Modify the content and style of text outputs. 0 = minimal and narrow output for terminal with limited width, 1 = normal output with bar column visible, 2 = same as 1 except rate is visible in summary and weekly outputs, 3 = rate column is visible in all outputs where it is supported. (vnstat and vnstati only) QueryMode Default query mode when no parameters are given. 0 = normal, 1 = days, 2 = months, 3 = top10, 4 = dumpdb, 5 = short, 6 = weeks, 7 = hours and 8 = xml. (vnstat only) RateUnit Select which unit is used when traffic rate is visible. 0 = bytes, 1 = bits. (vnstat and vnstati only) RXCharacter, TXCharacter Character used for representing the percentual share of received and transmitted traffic in daily output. (vnstat only) RXHourCharacter, TXHourCharacter Character used for representing the percentual share of received and transmitted traffic in hourly output. (vnstat only) Sampletime Defines how many seconds the -tr option will sample traffic. (vnstat only) TrafficlessDays Log days without any traffic to daily list. 1 = enabled, 0 = disabled. (vnstat and vnstatd only) UnitMode Select how units are prefixed. 0 = IEC standard prefixes (KiB/MiB/GiB/TiB), 1 = old style binary prefixes (KB/MB/GB/TB). (vnstat and vnstati only) UseFileLocking Enable or disable the use of file locking during database access. Disabling file locking may cause database corruption if several processes are trying to write to the file at the same time. DAEMON RELATED KEYWORDS
LogFile Specify log file path and name to be used if UseLogging is set to 1. OfflineSaveInterval How often in minutes cached interface data is saved to file when all monitored interfaces are offline. PidFile Specify pid file path and name to be used. PollInterval How often in seconds interfaces are checked for status changes. SaveInterval How often in minutes cached interface data is saved to file. SaveOnStatusChange Enable or disable the additional saving to file of cached interface data when the availability of an interface changes, i.e., when an interface goes offline or comes online. 1 = enabled, 0 = disabled. UpdateInterval How often in seconds the interface data is updated. UseLogging Enable or disable logging. 0 = disabled, 1 = logfile and 2 = syslog. IMAGE OUTPUT RELATED KEYWORDS
CBackground Background color. CEdge Edge color if visible. CHeader Header background color. CHeaderTitle Header title text color. CHeaderDate Header date text color. CLine Line color. CLineL Lighter version of line color. Set to '-' in order to use a calculated value based on CLine. CRx Color for received data. CRxD Darker version of received data color. Set to '-' in order to use a calculated value based on CRx. CText Common text color. CTx Color for transmitted data. CTxD Darker version of transmitted data color. Set to '-' in order to use a calculated value based on CTx. HeaderFormat Formatting of date in header. Uses the same format as date(1). HourlyRate Show hours with rate instead of transfered amount. 1 = enabled, 0 = disabled. SummaryLayout Select the used layout of the summary output. 1 = layout introduced in version 1.8 with monthly traffic included, 0 = layout used before version 1.8, doesn't contain monthly traffic and doesn't support average rate. SummaryRate Show rate in summary output if available. 1 = enabled, 0 = disabled. TransparentBg Set background color as transparent. 1 = enabled, 0 = disabled. FILES
/etc/vnstat.conf Config file that will be used unless $HOME/.vnstatrc exists or alternative value is given as command line parameter. AUTHOR
Teemu Toivola <tst at iki dot fi> SEE ALSO
vnstat(1), vnstati(1), vnstatd(1), units(7) version 1.11 JUNE 2011 VNSTAT.CONF(5)
All times are GMT -4. The time now is 02:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy