Search Results

Search: Posts Made By: guinch
103,674
Posted By Scrutinizer
Sure: awk ' { ORS=(ORS==RS)?FS:RS # If...
Sure:
awk '
{
ORS=(ORS==RS)?FS:RS # If the output record separator is equal to RS ("\n") then set it to a FS ( " " ) else set it to RS ("\n"), thus alternating between newline and space.
...
103,674
Posted By Klashxx
A perl: perl -ne '/Policy...
A perl:
perl -ne '/Policy Name:\s*(\S+)/;$pol=$1;print $pol." ".$1."\n" if /Active:\s*(\S+)/' infile
103,674
Posted By elixir_sinari
Using cat, cut, tr and paste: cat...
Using cat, cut, tr and paste:

cat filename|cut -d':' -f2|tr -d ' '|paste -s -d" \n" -
103,674
Posted By Scrutinizer
awk '{ORS=(ORS==RS)?FS:RS; print $NF}' infile
awk '{ORS=(ORS==RS)?FS:RS; print $NF}' infile
103,674
Posted By drl
Hi. An alternate with sed , cut , paste: ...
Hi.

An alternate with sed , cut , paste:
#!/usr/bin/env bash

# @(#) s1 Demonstrate combine lines fro specific column (field).

pe() { for _i;do printf "%s" "$_i";done; printf "\n"; }
pl() {...
103,674
Posted By jgt
Or if you are having problems with awk. ...
Or if you are having problems with awk.

while read a b
do
read c d
echo $b $d
done <inputfile
103,674
Posted By jim mcnamara
awk 'NR%2 {keep=$2; next} !NR%2 {print...
awk 'NR%2 {keep=$2; next}
!NR%2 {print keep, $2} ' inputfile > outputfile
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 09:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy