![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| convert columns into rows | Nishithinfy | Shell Programming and Scripting | 1 | 07-06-2009 12:16 PM |
| convert rows into columns | loperam | Shell Programming and Scripting | 2 | 12-01-2008 03:57 AM |
| how to convert columns to rows | suresh3566 | Shell Programming and Scripting | 6 | 11-04-2008 08:20 AM |
| How to convert a single column into several rows and columns? | ashton_smith | UNIX for Dummies Questions & Answers | 5 | 05-24-2008 05:44 PM |
| convert rows into column | cdfd123 | Shell Programming and Scripting | 3 | 01-11-2008 12:54 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
convert rows to single row
Hi I want to convert multiple rows ro single row ,I have tried with below one but I am not getting what I am expecting.Please any idea Code:
a.txt
[a.s1.txt]
conn1=stg
conn2=dev
path=\xxx\a1.txt
fre=a
[a.s2.txt]
conn1=stg
conn2=dev
path=\xxx\a2.txt
freq=a
awk '/a/{ORS=" "}{print}END{print "\n"}' a.txt
[a.s1.txt] conn1=stg conn2=dev path=\xxx\a1.txt fre=a [a.s2.txt] conn1=stg conn2=dev path=\xxx\a2.txt freq=a
I am expecting the below
[a.s1.txt] conn1=stg conn2=dev path=\xxx\a1.txt fre=a
[a.s2.txt] conn1=stg conn2=dev path=\xxx\a2.txt freq=a
Thanks, Akil |
|
||||
|
Hi
Thanks,Its working fine Akil ---------- Post updated at 02:16 AM ---------- Previous update was at 02:09 AM ---------- Hi Sorry ,I have got the below error when call this awk '$1=$1' RS= OFS=" " ORS="\n\n" a.txt1 awk: Input line [a.Addr cannot be longer than 3,000 bytes. The source line number is 1. I found the problem,there is no space between s1.txt s2.txt lines,Please any idea how to create the space [a.s1.txt] conn1=stg conn2=dev path=\xxx\a1.txt fre=a [a.s2.txt] conn1=stg conn2=dev path=\xxx\a2.txt freq=a Thanks, Akil Last edited by akil; 10-15-2009 at 04:25 AM.. |
|
||||
|
Hi I want to add connection parameter value in each entry Code:
[a.s1.txt] conn1=stg conn2=dev path=\xxx\a1.txt fre=a [a.s2.txt] conn1=stg conn2=dev path=\xxx\a2.txt freq=a EXPECTING O/P [a.s1.txt] conn1=stg conn2=dev path=\xxx\a1.txt fre=a connection=SRC [a.s2.txt] conn1=stg conn2=dev path=\xxx\a2.txt freq=a connection=SRC Thanksinadvance Akil |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|