![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Hi
I am formatting informix isql output(vertical) to horizontal format. Suppose I have the following content in the flat file from isql output - item_nbr 0 usfn_label Subscriber Class usfn_name SBCLASS usfn_value bl5 item_nbr 1 usfn_label Switch Name usfn_name switchName usfn_value pyrw2 I have to format it like - item_nbr usfn_label usfn_name usfn_value 0 Subscriber Class SBCLASS bl5 1 Switch Name switchName pyrw2 I printed the column headers in the output file and then I want to get the column values. I used 'cut' to get the values like this in a file tmp- 0 Subscriber Class SBCLASS bl5 1 Switch Name switchName pyrw2 Now the problem is whenever I am trying to print the values in the output file, they are appearing with newline (\n) and I am not getting the horizontal format. As if there is a newline after '0', 'Subscriber Class' etc and the print command is also printing the newline - while read line do if [ -n "$line" ];then print "$line\t" >> out else print "\n" >> out fi done<tmp But 'out' has the same format like 'tmp' . I have tried several values for IFS without any success.So how we can read vertically and print them horizontally ???? Please show me the light .... Thanks |
|
||||
|
Is it possible to change isql command .. Which will better that a shell script ..
Check with SyBooks Online -w columnwidth Default= 80 characters meaning = Changes the line width |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| isql output | d_swapneel14 | Shell Programming and Scripting | 6 | 11-05-2009 07:31 AM |
| isql output file not created while running it through cron | vikram3.r | Shell Programming and Scripting | 2 | 11-05-2009 06:19 AM |
| ksh + isql => output cut at 2 GB | bereman | Shell Programming and Scripting | 1 | 09-16-2009 08:16 AM |
| Isql Data format | siquadri | Shell Programming and Scripting | 1 | 04-22-2009 04:54 PM |
| formatting a Compact Flash in DOS format | dreamsurfer | Windows & DOS: Issues & Discussions | 1 | 03-19-2002 11:43 PM |