Sponsored Content
Top Forums Shell Programming and Scripting Filtering out lines in a .csv file Post 302774583 by dev.devil.1983 on Saturday 2nd of March 2013 12:46:30 PM
Old 03-02-2013
Hi Jim,

the sample file looks like this .. there are 18 columns in total, out of which last 3 are amount columns(D1 D2 D3), having certain values.. nothing has to be changed in the file .. the requirement is to read the last 3 columns of the file and in case any row has a value greater than '1' .. in that case 'a set of instructions' have to be executed..

Code:
H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 D1 D2 D3
                                                  0   0   0
                                                  0   0   1
                                                  0   0   0
                                                  1   0   1
 
.....................
..............


thanks,
Dev
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting Lines from .csv file

Hello All, I have a .csv file and I have to delete the selcted records stored in a vairable e.g echo $lname 7 88 91 94 97 100 103 106 I dont know how to pass the variable name to "sed" for deleting the $lname from a file can any one help as this is very urgent. $lname is changing the... (3 Replies)
Discussion started by: 009satya
3 Replies

2. Homework & Coursework Questions

Displaying specific lines from a CSV file

1. The problem statement, all variables and given/known data: Display from a csv file, birthdays that occur today. If there are no birthdays today, the next one in the year. 2. Relevant commands, code, scripts, algorithms: The csv file is ordered from older to younger (ie. the most recent... (8 Replies)
Discussion started by: Adzi
8 Replies

3. Shell Programming and Scripting

Help with pulling / filtering data from a .csv

Good day Gurus, I have a csv file that contains an inventory of active servers. This csv file contains a well over a hundred systems (IBM, SUN, HP). It also contains those systems details. See below for an example hostA,invver,1.02,20100430 hostA,date,08/30/2010,06:18 hostA,use,"Unknown... (4 Replies)
Discussion started by: LuffyDMonkey
4 Replies

4. Shell Programming and Scripting

Removing lines of a .csv file

Hello, Does anyone have a one-liner to remove lines of a csv file if the value in a specific column is zero? For example, I have this file, 12345,COM,5,0,N,29.95,Y 12345,MOM,1,0,N,29.95,Y 12345,COM,4,0,N,9.99,Y 12345,MOM,0,2,N,9.99,Y 12345,REN,0,1,N,9.99,Y and I want to remove lines... (4 Replies)
Discussion started by: palex
4 Replies

5. Shell Programming and Scripting

Reading 2 CSV files and filtering data based on group

I have two CSV files in the following format: First file: GroupID, PID:TID, IP, Port Sample data: 0,1000:11,127.0.0.1,445 0,-1:-1,127.0.0.1,800 1,1000:11,127.0.0.1,445 1,-1:-1,127.0.0.1,900 2,1000:11,127.0.0.1,445 2,-1:-1,180.0.0.3,900 Second file: IP,Port,PID Sample data... (6 Replies)
Discussion started by: rakesh_arxmind
6 Replies

6. Shell Programming and Scripting

Filtering data from text to csv

Hello, Is there a way to filerter data from a text file as shown below to a Column e.g. hostname nfsmount as two separate column. Currently I could get hostname and the mount is appearing below.. using this script #! /bin/bash for i in `cat fqdn.txt` do echo "$i ............ " >>... (3 Replies)
Discussion started by: Cy Pqa
3 Replies

7. Shell Programming and Scripting

Filtering log file with lines older than 10 days.

Hi, I am trying to compare epoch time in a huge log file (2 million lines) with todays date. I have to create two files one which has lines older than 10 days and another file with less than 10 days. I am using while do but it takes forever to complete the script. It would be helpful if you can... (12 Replies)
Discussion started by: shunya
12 Replies

8. Shell Programming and Scripting

Need help with csv filtering

Hello everyone, i am stuck with a task i was meant to do so i came here. So i have a .csv file which structure is : year;temperature;precipitation 2012;32;483 2006;28;517 ... I want to note that it is in fact ";" not a space, which a new file named <old-name>-new.txt, the first line must ... (2 Replies)
Discussion started by: Needhelp123
2 Replies

9. UNIX for Beginners Questions & Answers

Filtering records of a csv file based on a value of a column

Hi, I tried filtering the records in a csv file using "awk" command listed below. awk -F"~" '$4 ~ /Active/{print }' inputfile > outputfile The output always has all the entries. The same command worked for different users from one of the forum links. content of file I was... (3 Replies)
Discussion started by: sunilmudikonda
3 Replies

10. UNIX for Beginners Questions & Answers

Convert a horizontal lines to vertical lines in a csv file

Hi.. I need some help in converting the below horizontal lines to vertical lines format. can anyone help me on this. input file Hour,1,2,3,4,5 90RT,106,111,111,112,111 output file Hour,90RT 1,106 2,111 3,111 4,112 5,111 (3 Replies)
Discussion started by: Raghuram717
3 Replies
WMTV(1) 						      General Commands Manual							   WMTV(1)

NAME
wmtv - dockable video4linux TV player for WindowMaker. SYNOPSIS
wmtv [--exe program] DESCRIPTION
wmtv is a dockable video4linux TV player. It supports channel presets, PAL/Secam/NTSC, fine tuning, full screen display, ... OPTIONS
-c, --device Specifies the video4linux device to use. -d, --display Specifies the X server to contact. -e, --exe Launch an external TV player when the screen is double clicked. It is possible to pass some parameters to this external application with % codes. USAGE
This sections describes how to use the application in docked state. See below for fullscreen mode usage. Button map: [ < ] [ > ] [ 0 ] <1> <2> <3> There are 3 modes of operation on this applications. You can cycle through the 3 modes by clicking on the right most button <3>. The 3 modes are described below: On mode Clicking on the rightmost button <3> for the first time (after the start of WMTV) will turn the TV on. While in this mode, the left <1> and right <2> buttons change to preset channels which has been defined in your config file. Use the left button to move down one channel and the right button to move up one channel. Tune mode Clicking again on button <3> after On mode will change WMTV into tune mode. Left-clicking on the left <1> or right <2> button performs a channel scan. Scanning stops when there is a strong signal strength. Right-clicking on the left <1> or right <2> button fine tunes the current channel. After tuning, clicking on button <3> saves the fine tuning to your config file and brings you back into "On mode". Off mode Holding down button <3> for about 3 seconds from any of the two modes described above turns the TV off. Right-clicking the TV screen mutes/unmutes the audio. Double left-clicking the TV screen launches the application specified with --exe. If --exe was not specified, then the built-in full-screen mode is used instead. Double middle-clicking will always invoke the built-in full screen mode. FULL SCREEN MODE
To exit full screen mode, click. Keyboard functions Up - Change to next preset channel. Down - Change to previous preset channel. Right - Increase volume. (If supported by the v4l device.) Left - Decrease volume. (If supported.) Escape - Leave full screen mode. m - mute/unmute. EXTERNAL APPLICATION
It is possible to pass some parameters to the external application through % codes: %% is replaced by a single %. %n is replaced by the name of the current channel. %# is replaced by the number of the current channel. %f is replaced by the current frequency in MHz. The behavior of other % codes is undefined and subject to change. Example: wmtv -e 'xawtv "%n"' CONFIGURATION FILE
This section describes the format of WMTV's configuration file. It is located in your home directory under ".wmtvrc". Excerpt from a sample config file: /*----------------------- source = Television freqnorm = pal-australia maxpreset = 7 mode = pal fullscreen = 640x480 [channel] 2 NAME 7 FOO 9 BAR 10 FOOBAR 32 (50) SE11 S21 LAST CHANNEL -------------------------*/ Settings source = { Television | CompositeX | S-Video } (X is an integer) freqnorm = { ntsc-bcast | ntsc-cable | ntsc-cable-hrc | ntsc-bcast-jp | ntsc-cable-jp | pal-europe | pal-europe-east | pal-italy | pal- newzealand | pal-australia | pal-ireland | secam-france } maxpreset = integer (maximum channel presets) mode = { pal | ntsc | secam } fullscreen = widthxheight [channel] Choose a total of <maxpreset> from the below channels. Separate the channels with a new line as in the sample config file above. { E2 | E3 | E4 | S01 | S02 | S03 | R1 | R2 | R3 | R4 | R5 | SE1 | SE2 | SE3 | SE4 | SE5 | SE6 | SE7 | SE8 | SE9 | SE10 | E5 | E6 | E7 | E8 | E9 | E10 | E11 | E12 | R6 | R7 | R8 | R9 | R10 | R11 | R12 | SE11 | SE12 | SE13 | SE14 | SE15 | SE16 | SE17 | SE18 | SE19 | SE20 | S21 | S22 | S23 | S24 | S25 | S26 | S27 | S28 | S29 | S30 | S31 | S32 | S33 | S34 | S35 | S36 | S37 | S38 | S39 | S40 | S41 | T7 | T8 | T9 | T10 | T11 | T12 | T13 | T14 | K01 | K02 | K03 | K04 | K05 | K06 | K07 | K08 | K09 | K10 | KB | KC | KD | KE | KF | KG | KH | KI | KJ | KK | KL | KM | KN | KO | KP | KQ | H01 | H02 | H03 | H04 | H05 | H06 | H07 | H08 | H09 | H10 | H11 | H12 | H13 | H14 | H15 | H16 | H17 | H18 | H19 | 1 - 125 } Finetune parameters could be added in brackets, spaced after the channel. A name for the channel can also be specified, tabbed after the finetune. for example: 32 (50) # channel 32 plus 50 or SE11 LAST CHANNEL # channel SE11 called "LAST CHANNEL" FILES
/etc/wmtvrc System wide config file. ~/.wmtvrc Users config file. AUTHOR
This manual page was first written by Remi Lefebvre <remi@debian.org>, and then modified by Nicolas Boullis <nboullis@debian.org>, for the Debian GNU/Linux system (but may be used by others). This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. It is widely based on the README provided with the program. August 2005 WMTV(1)
All times are GMT -4. The time now is 05:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy