Sponsored Content
Top Forums Shell Programming and Scripting awk - sed :Help Getting next lines data . Post 302760821 by rdrtx1 on Thursday 24th of January 2013 04:00:12 PM
Old 01-24-2013
try:
Code:
awk '
/^bad/ || /[ \t]bad/ {
  nf=NF; cl=$0; getline nl; $0=cl " " nl;
  for (i=1; i<=nf; i++) {
     if ($(i) ~ /^bad/) out=out $(i) FS $(i+nf) " | ";
  }
}
END {sub("[ |]*$","",out); print out}
' infile

This User Gave Thanks to rdrtx1 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk / shell - Fix broken lines and data

Gurus, I am struggling with a issue and thought I could use some of your expertise. Need Help with this I have a flat file that has millions of records 24|john|account ~ info |56| 25|kuo|account ~ journal |58| 27|kim|account ~ journal |59| 28|San|account ~ journal |60|... (3 Replies)
Discussion started by: rimss
3 Replies

2. Shell Programming and Scripting

Inserting Lines between data sets using SED?

Hello all and thanks in advance! What I'm looking to do is insert a blank line, anytime the first 9 characters of a given line don't match the first 9 characters of the previous line. i.e. Convert the data set 1 45 64 89 1 89 69 235 2 89 234 67 2 56 90... (1 Reply)
Discussion started by: selkirk
1 Replies

3. Shell Programming and Scripting

how to awk a data from seperate lines

Hi guys, i have a problem which im hoping you will be able to help me with. I have follwing output :- ------------------------------------------------------------------------------- NSTEP = 407000 TIME(PS) = 43059.000 TEMP(K) = 288.46 PRESS = 0.0 Etot = -2077.4322 ... (2 Replies)
Discussion started by: Mish_99
2 Replies

4. Shell Programming and Scripting

Manipulate lines with sed/awk

Hey All, I need to reorganize a file's text. Here is the source: host John_Doe filename "config.cfg"; hardware ethernet 98:10:3d:13:8f:98; fixed-address 10.10.10.29; } host Jane_Doe filename "config.cfg"; hardware ethernet 98:13:11:fd:5a:57; fixed-address 10.10.5.24; } host... (2 Replies)
Discussion started by: TheBigAmbulance
2 Replies

5. Shell Programming and Scripting

[AWK] handeling data spread on multiple lines

Hello all, first off great forum. Now for my little problem. Using RHEL 5.4 and awk. Been doing code since a few month. So just starting. My problem is handeling data on multiple lines. { if ($1 != LASTKEY && h ~ /.*\/s_fr_/) { checkgecos( h, h ) h="" ... (2 Replies)
Discussion started by: maverick72
2 Replies

6. Shell Programming and Scripting

Extracting specific lines of data from a file and related lines of data based on a grep value range?

Hi, I have one file, say file 1, that has data like below where 19900107 is the date, 19900107 12 144 129 0.7380047 19900108 12 168 129 0.3149017 19900109 12 192 129 3.2766666E-02 ... (3 Replies)
Discussion started by: Wynner
3 Replies

7. Shell Programming and Scripting

Removing repeating lines from a data frame (AWK)

Hey Guys! I have written a code which combines lots of files into one big file(.csv). However, each of the original files had headers on the first line, and now that I've combined the files the headers are interspersed throughout the new combined data frame. For example, throughout the data... (21 Replies)
Discussion started by: gd9629
21 Replies

8. Shell Programming and Scripting

Sed/awk to delete single lines that aren't touching other lines

Hello, I'm trying to figure out how to use sed or awk to delete single lines in a file. By single, I mean lines that are not touching any other lines (just one line with white space above and below). Example: one two three four five six seven eight I want it to look like: (6 Replies)
Discussion started by: slimjbe
6 Replies

9. Shell Programming and Scripting

Summing over specific lines and replacing the lines with the sum using sed, awk

Hi friends, This is sed & awk type question. I have a text file which has numbers spread all over the file. I want to sum the series of numbers whenever i find it and produce an output file with the sum. For example ###start of input text file #### abc def ghi 1 2 3 4 kjld random... (3 Replies)
Discussion started by: kaaliakahn
3 Replies

10. Shell Programming and Scripting

awk - mixed for and if to select particular lines in a data file

Hi all, I am new to AWK and I am trying to solve a problem that is probably easy for an expert. Suppose I have the following data file input.txt: 20 35 43 20 23 54 20 62 21 20.5 43 12 20.5 33 11 20.5 89 87 21 33 20 21 22 21 21 56 87 I want to select from all lines having the... (4 Replies)
Discussion started by: naska
4 Replies
LEGENDRE(3)						User Contributed Perl Documentation					       LEGENDRE(3)

NAME
PDL::GSLSF::LEGENDRE - PDL interface to GSL Special Functions DESCRIPTION
This is an interface to the Special Function package present in the GNU Scientific Library. SYNOPSIS
Functions FUNCTIONS
gsl_sf_legendre_Pl Signature: (double x(); double [o]y(); double [o]e(); int l) P_l(x) gsl_sf_legendre_Pl does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_legendre_Pl_array Signature: (double x(); double [o]y(num); int l=>num) P_l(x) from 0 to n-1. gsl_sf_legendre_Pl_array does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_legendre_Ql Signature: (double x(); double [o]y(); double [o]e(); int l) Q_l(x) gsl_sf_legendre_Ql does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_legendre_Plm Signature: (double x(); double [o]y(); double [o]e(); int l; int m) P_lm(x) gsl_sf_legendre_Plm does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_legendre_Plm_array Signature: (double x(); double [o]y(num); int l=>num; int m) P_lm(x) for l from 0 to n-2+m. gsl_sf_legendre_Plm_array does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_legendre_sphPlm Signature: (double x(); double [o]y(); double [o]e(); int l; int m) P_lm(x), normalized properly for use in spherical harmonics gsl_sf_legendre_sphPlm does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_legendre_sphPlm_array Signature: (double x(); double [o]y(num); int n=>num; int m) P_lm(x), normalized properly for use in spherical harmonics for l from 0 to n-2+m. gsl_sf_legendre_sphPlm_array does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_conicalP_half Signature: (double x(); double [o]y(); double [o]e(); double lambda) Irregular Spherical Conical Function P^{1/2}_{-1/2 + I lambda}(x) gsl_sf_conicalP_half does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_conicalP_mhalf Signature: (double x(); double [o]y(); double [o]e(); double lambda) Regular Spherical Conical Function P^{-1/2}_{-1/2 + I lambda}(x) gsl_sf_conicalP_mhalf does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_conicalP_0 Signature: (double x(); double [o]y(); double [o]e(); double lambda) Conical Function P^{0}_{-1/2 + I lambda}(x) gsl_sf_conicalP_0 does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_conicalP_1 Signature: (double x(); double [o]y(); double [o]e(); double lambda) Conical Function P^{1}_{-1/2 + I lambda}(x) gsl_sf_conicalP_1 does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_conicalP_sph_reg Signature: (double x(); double [o]y(); double [o]e(); int l; double lambda) Regular Spherical Conical Function P^{-1/2-l}_{-1/2 + I lambda}(x) gsl_sf_conicalP_sph_reg does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_conicalP_cyl_reg_e Signature: (double x(); double [o]y(); double [o]e(); int m; double lambda) Regular Cylindrical Conical Function P^{-m}_{-1/2 + I lambda}(x) gsl_sf_conicalP_cyl_reg_e does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_legendre_H3d Signature: (double [o]y(); double [o]e(); int l; double lambda; double eta) lth radial eigenfunction of the Laplacian on the 3-dimensional hyperbolic space. gsl_sf_legendre_H3d does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_legendre_H3d_array Signature: (double [o]y(num); int l=>num; double lambda; double eta) Array of H3d(ell), for l from 0 to n-1. gsl_sf_legendre_H3d_array does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. AUTHOR
This file copyright (C) 1999 Christian Pellegrin <chri@infis.univ.trieste.it> All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL SF modules were written by G. Jungman. perl v5.12.1 2010-07-05 LEGENDRE(3)
All times are GMT -4. The time now is 11:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy