Sponsored Content
Full Discussion: get rid of unwanted lines
Top Forums Shell Programming and Scripting get rid of unwanted lines Post 302683939 by ptappeta on Thursday 9th of August 2012 12:43:41 AM
Old 08-09-2012
get rid of unwanted lines

Hi ,

My output contains the below contents

When i execute
Code:
 
df -h | grep / | grep -v '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }'

i get output as below

Code:
 
tpshghghg.fgh.com:/vol/scmvol1/scm-vobstore/WebArch.vbs
                      1.7T  1.3T  452G  74% /vob/WebArch
tpshghghg.fgh.com:/vol/scmvol1/scm-vobstore/Analyst_Metrics.vbs
                      1.7T  1.3T  452G  74% /vob/Analyst_Metrics
tpshghghg.fgh.com:/vol/scmvol1/scm-vobstore/Analyst_Metrics_Admin.vbs
                      1.7T  1.3T  452G  74% /vob/Analyst_Metrics_Admin
tpshghghg.fgh.com:/vol/scmvol1/scm-vobstore/ioscomp_tot.vbs
                      1.7T  1.3T  452G  74% /vob/ioscomp_tot
tpshghghg.fgh.com:/vol/scmvol1/scm-vobstore/vob_etl_framework.vbs
                      1.7T  1.3T  452G  74% /vob_etl_framework
tpshghghg.fgh.com:/vol/scmvol1/scm-vobstore/vob_pdsweb.vbs
                      1.7T  1.3T  452G  74% /vob_pdsweb
tpshghghg.fgh.com:/vol/scmvol1/scm-vobstore/vob_nz_tick.vbs
                      1.7T  1.3T  452G  74% /vob_nz_tick
tpshghghg.fgh.com:/vol/scmvol1/scm-vobstore/vob_rdrcore.vbs
                      1.7T  1.3T  452G  74% /vob_rdrcore
tpshghghg.fgh.com:/vol/scmvol1/scm-vobstore/vob_sts_dashboard.vbs
                      1.7T  1.3T  452G  74% /vob_sts_dashboard
ghghg.fgh.com:/vol/scmvol1/fi-vobstore/vob_ewsmatlab.vbs
                      335G  259G   77G  78% /vob_ewsmatlab
ghghg.fgh.com:/vol/scmvol1/fi-vobstore/vob_fabricserver.vbs
                      335G  259G   77G  78% /vob_fabricserver
tpshghghg.fgh.com:/vol/scmvol1/scm-vobstore/vob_arrow2.vbs

now I would need to get rid of all the unnecessary lines like

ghghg.fgh.com:/vol/scmvol1/fi-vobstore/vob_ewsmatlab.vbs

tpshghghg.fgh.com:/vol/scmvol1/scm-vobstore/vob_sts_dashboard.vbs

any help on this pls.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Filter unwanted lines

Hi All, I have the below input and i only want to filter out some un-wanted info from here. Expected output is below. Can somebody help ? The catch is that i want to grep those lines with term "k=" and lines with term "**" as the 1st column and "07" as the last column. And the number of... (15 Replies)
Discussion started by: Raynon
15 Replies

2. Shell Programming and Scripting

Get rid of first & last lines from STD_OUT

I have an application that executes, printing a bunch of text to the screen... only problem is that I don't want to see the first line (the internal command being run) or the last line (it says "done") is there something to chop off the first and last line simply through use of piping the... (2 Replies)
Discussion started by: jjinno
2 Replies

3. UNIX for Advanced & Expert Users

How to Remove the unwanted Blank Lines

I have a file with the below data, i would like to remove the end blank lines with no data. I used the below commands but could not able to succeed, could you please shed some light. Commands Used: sed '/^$/d' input.txt > output.txt grep -v '^$' input.txt > output.txt input.txt file... (5 Replies)
Discussion started by: Ariean
5 Replies

4. Shell Programming and Scripting

Remove unwanted lines

I have a .xml file, where i need some output. The xml file is like: Code: <?******?></ddddd><sssss>234</dfdffsdf><sdhjh>534</dfdfa>......... /Code I need the output like: code 234 534 . . . /code How can i do it? (5 Replies)
Discussion started by: anupdas
5 Replies

5. Shell Programming and Scripting

grep out unwanted lines

Hi, I got a log file and I want to grep out a list of unwanted line which are IP's. Basiclly I want everything ecxept the ip's from my list. If I do a while read line do grep -v $ip_from_my_list logfile done <ip_list it just grep's one IP at a time and repeats. :( Thanks for... (3 Replies)
Discussion started by: stinkefisch
3 Replies

6. Shell Programming and Scripting

Need to delete unwanted files!!!

Hi all, i am just a beginner in shell. Need some code for my problem. SCENARIO I have 2 directories. Let A,B. Everyday files from directory A are compressed and moved to B.(already got the script). In directory A abc.doc def.exe ghi.c jkl.pl In directory B abc.tar.gz... (1 Reply)
Discussion started by: debu182
1 Replies

7. Shell Programming and Scripting

sed to get rid of unwanted characters

so i have strings such as this: 'postfix/local#2,5#|CRON.*12062.*root.*CMD#2,5#|roice.*NQN1#1,2#|toysprc#1,4#' i need to get rid of the "#" and the numbers between them for each of the strings above. so the desired output should be: ... (1 Reply)
Discussion started by: SkySmart
1 Replies

8. Shell Programming and Scripting

awk prints unwanted new lines

Hello, I need a little help with the following: I'm using AWK to read input from a comma-seperated value file, and only printing certain fields like so: awk -F "," '{print $1,$3,$6}' /list.csv | tail -1 Which outputs the following: server1 APPID OS I run into a problem... (8 Replies)
Discussion started by: LinuxRacr
8 Replies

9. Shell Programming and Scripting

For loop to get rid of first 2 lines(conditionally)

hello all, I get data from different vendors and need to clean it up. Usually it pretty straight forward when i have files that only have headers....but in my case i have files that have a starting line of file name(and some junk info) and 2nd line is headers and the 3rd line is were the actual... (11 Replies)
Discussion started by: crazy_max
11 Replies

10. Web Development

Getting Rid of Annoying Bootstrap Table Borders and Wayward Table Lines

Bootstrap is great; but we have had some issues with Bootstrapped <tables> (and legacy <fieldset> elements) showing annoying, wayward lines. I solved that problem today with this simple jQuery in the footer: <script> $(function(){ $('tr, td, fieldset,... (0 Replies)
Discussion started by: Neo
0 Replies
IFX_HTMLTBL_RESULT(3)							 1						     IFX_HTMLTBL_RESULT(3)

ifx_htmltbl_result - Formats all rows of a query into a HTML table

SYNOPSIS
int ifx_htmltbl_result (resource $result_id, [string $html_table_options]) DESCRIPTION
Formats and prints all rows of the $result_id query into a HTML table. PARAMETERS
o $result_id -$result_id is a valid resultid returned by ifx_query(3) or ifx_prepare(3) (select type queries only!). o $html_table_options - This optional argument is a string of <table> tag options. RETURN VALUES
Returns the number of fetched rows, or FALSE on errors. EXAMPLES
Example #1 Informix results as HTML table <?php $rid = ifx_prepare ("select * from emp where name like " . $name, $connid, IFX_SCROLL); if (! $rid) { /* ... error ... */ } $rowcount = ifx_affected_rows ($rid); if ($rowcount > 1000) { printf ("Too many rows in result set (%d) <br />", $rowcount); die ("Please restrict your query<br /> "); } if (! ifx_do($rid)) { /* ... error ... */ } ifx_htmltbl_result ($rid, "border="2""); ifx_free_result($rid); ?> PHP Documentation Group IFX_HTMLTBL_RESULT(3)
All times are GMT -4. The time now is 09:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy