08-02-2008
facing problem in getting output on single line
i am using these two grep commands
grep "^tipo" dump3_out.dat|awk -F"," '{for(i=1;i<=NF;i++){A=$i;B=substr($i, index($i, "=")+1);{print B }}}'|paste -s -d"||\n"|sed -e 's/^ //g' -e 's/| /|/g' >> result.dat
grep -n "^ind" dump3_out.dat|cut -d "=" -f2|cut -d "," -f2|cut -d "n" -f1|tr -d '^ ' >> result.dat
my out put appears as:
abonado simplex|dic1 - none|estandar
0
abonado simplex|dic1 - none|estandar
0
abonado simplex|dic1 - none|estandar
0
abonado simplex|dic1 - none|estandar
0
i want my out as :
abonado simplex|dic1 - none|estandar|0
abonado simplex|dic1 - none|estandar|0
abonado simplex|dic1 - none|estandar|0
abonado simplex|dic1 - none|estandar|0
please help
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
How can I take the following output:
outputa
outputb
outputc
and turn it into single line ouput, with a single space between each field like below:
outputa outputb outputc (7 Replies)
Discussion started by: LinuxRacr
7 Replies
2. Shell Programming and Scripting
hey gents,
I'm working on something that will use snmpwalk to query the devices on my network and retreive the device name, device IP, device model and device serial. I'm using Nmap for the enumeration and sed to clean up the results for use by snmpwalk. Once i get all the data organized I'm... (8 Replies)
Discussion started by: mitch
8 Replies
3. Shell Programming and Scripting
Hi Guys,
I have an oracle database, I am trying to query the database and route it to file.
But the records instead of coming in a single line, are coming in three lines.
Can you please help me.. in this..
sqlplus -s $SRMUserid/$SRMPassword@$SRMServer<< EOF >log.out;
select * from... (5 Replies)
Discussion started by: mac4rfree
5 Replies
4. Shell Programming and Scripting
Hi,
I got a list of file that all got the same standard format.
Can anyone teach me how to put the space in all of them?!
Input file:
>nucleotide1
AAAAAAAAACCCGGG
>nucleotide2
GGGGGGCCCCCTTTTA
>nucleotide3
GGTACACCACACTCAC
>nucleotide4
TTTGGAGAGAGACCCC
desired output:... (4 Replies)
Discussion started by: patrick87
4 Replies
5. Shell Programming and Scripting
Hi All,
Small script but :wall:, please help in this regard.
for i in 1 2 3
do
echo $i
done
result :
1
2
3
I want the above to be printed as below
expected result:
1 2 3
Thanks in advance :) (3 Replies)
Discussion started by: girish_satyam
3 Replies
6. Shell Programming and Scripting
Hello
I did do a search and the past threads doesn't really solve my issue. (using various awk commands)
I need to combine the output from java -version into 1 line, but I am having difficulties.
When you exec java -version, you get:
java version "1.5.0_06"
Java(TM) 2 Runtime... (5 Replies)
Discussion started by: flagman5
5 Replies
7. Shell Programming and Scripting
Hi,
My Oracle query is returing below o/p
----------------------------------------------------------
Ins trnas value
a lkp1 x
a lkp1 y
b lkp1 a
b lkp2 x
b lkp2 y ... (7 Replies)
Discussion started by: gvk25
7 Replies
8. Shell Programming and Scripting
Hi,
I am using below command and getting below output.
echo "dis ql(*) CLUSTER"|runmqsc CT.QM.ASSA10T1| egrep 'QUEUE|CLUSTER'|egrep -v 'SYSTEM|XMITQ'| sed -e 's/QUEUE(/ /g' -e 's/TYPE(QLOCAL)/ /g' -e 's/CLUSTER(/ /g' -e 's/)/ /g'
output
CT.CL.ALLUHUB.FLST_TO_HUB_PROV.01... (20 Replies)
Discussion started by: darling
20 Replies
9. Shell Programming and Scripting
Hi all,
I have a single line output like below
echo $ips
10.26.208.28 10.26.208.26 10.26.208.27
want to convert above single line output as below format. Pls advice how to do ?
10.26.208.28
10.26.208.26
10.26.208.27
Regards
Kannan (6 Replies)
Discussion started by: kamauv234
6 Replies
10. UNIX for Beginners Questions & Answers
example of problem:
when I echo "$e" >> /home/cogiz/file.txt
result prints to file as:AA
BB
CC
I need it to save to file as this:AA BB CC
I know it's probably something really simple but any help would be greatly appreciated.
Thank You.
Cogiz (7 Replies)
Discussion started by: cogiz
7 Replies
LEARN ABOUT XFREE86
zgrep
ZGREP(1) General Commands Manual ZGREP(1)
NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)
ZGREP(1)