![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Changing one column of delimited file column to fixed width column | manneni prakash | Shell Programming and Scripting | 5 | 06-22-2009 06:27 AM |
| How to check Null values in a file column by column if columns are Not NULLs | Mandab | Shell Programming and Scripting | 7 | 03-15-2008 09:57 AM |
| the very beginning | Mudrack | UNIX for Dummies Questions & Answers | 6 | 03-24-2005 05:46 AM |
| beginning unix | henroid815 | UNIX for Dummies Questions & Answers | 1 | 02-04-2004 02:59 PM |
| cat a file from end to beginning | jpprial | UNIX for Dummies Questions & Answers | 5 | 03-31-2001 09:14 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Add new column in Text File
I have one text file which is result of bdf command that have 6 fields separated by space and I want to add one new column in the beginning which is the name of the server because I have to insert whole thing into oracle table consisting of 7 fields
THis is not a complete list but it looks like this /dev/vg00/lvol4 1048576 314096 728792 30 / /dev/vg00/lvol1 1014648 65224 847952 7 /stand /dev/vg00/lvol8 4194304 1466880 2707320 35 /var /dev/vg3psw/lvol12 3145728 1221244 1804222 40 /var/mqm /dev/vg00/lvol10 4194304 3749008 441888 89 /var/adm/sw /dev/vg00/lvol9 4194304 16744 4144936 0 /var/adm/crash /dev/vg00/lvol7 5242880 1871472 3345104 36 /usr /dev/vg3psw/lvol1 4194304 3883768 308128 93 /usr/local /dev/vg3psw/lvol7 10338304 8812630 1430332 86 /usr/local/vertex /dev/vg3psw/lvol2 12738560 8080712 4622152 64 /usr/local/oracle /dev/vg3psw/lvol9 5120000 1286387 3594077 26 /usr/local/g1_3.2_SE /dev/vghome_old/lvol1 23552000 10375127 12353732 46 /usr/local/g1 /dev/vg3psw/lvol3 2097152 137104 1944800 7 /usr/local/dazel /dev/vg3psw/lvol8 1228800 302520 919104 25 /usr/local/ccmi /dev/vg3psw/lvol10 4096000 3714072 358119 91 /usr/local/TWS /dev/vgapp/lvol5 2097152 16192 2072336 1 /tuxhome /dev/vgapp02/lvol1 153616384 101215137 49155476 67 /tuxappl /dev/vg00/lvol6 1540096 36224 1496576 2 /tmp /dev/vgapp-io/lvol1 199155712 153646976 45332312 77 /tlgvar /dev/vgapp/lvol4 20971520 2912 20804800 0 /tlg /dev/vgapp/lvol2 65536000 1138720 63894248 2 /reports /dev/vgmafg/lvol1 52396032 6968 51982472 0 /pvdev /dev/vgapp/lvol6 204800 10712 192632 5 /p/sbms /dev/vgapp/lvol7 102498304 48416456 53670568 47 /p/sbms/mps /dev/vgdbcommon/lvol2 167755776 125249936 42183024 75 /oraexp /dev/vg00/lvol5 4194304 3641336 548688 87 /opt /dev/vg3psw/lvol11 3145728 527068 2455009 18 /opt/mqm /dev/vg3psw/lvol5 1048576 388952 654520 37 /opt/iona my table look like this Server_Status Name Null? Type ----------------------------------------- -------- ---------------------------- SERVER_ID NOT NULL NUMBER(6) FS_LOCAL_NAME NOT NULL VARCHAR2(200) LOCAL_MOUNT NOT NULL CHAR(1) TOTAL_SPACE NOT NULL NUMBER(10) USED_SPACE NUMBER(10) SPACE_AVAILABLE NUMBER(10) PERCENTAGE_USED NUMBER(3,2) so in this case can anyone help me how can i add one column there first and insert into that table ( perl, Korn shell ) kornshell is better thanks in advance help plz |
|
||||
|
FYI _______This is the one---------which I have posted before in the beginning
I have one text file which is result of bdf command that have 6 fields separated by space and I want to add one new column in the beginning which is the name of the server because I have to insert whole thing into oracle table consisting of 7 fields THis is not a complete list but it looks like this /dev/vg00/lvol4 1048576 314096 728792 30 / /dev/vg00/lvol1 1014648 65224 847952 7 /stand /dev/vg00/lvol8 4194304 1466880 2707320 35 /var /dev/vg3psw/lvol12 3145728 1221244 1804222 40 /var/mqm /dev/vg00/lvol10 4194304 3749008 441888 89 /var/adm/sw /dev/vg00/lvol9 4194304 16744 4144936 0 /var/adm/crash /dev/vg00/lvol7 5242880 1871472 3345104 36 /usr /dev/vg3psw/lvol1 4194304 3883768 308128 93 /usr/local /dev/vg3psw/lvol7 10338304 8812630 1430332 86 /usr/local/vertex /dev/vg3psw/lvol2 12738560 8080712 4622152 64 /usr/local/oracle /dev/vg3psw/lvol9 5120000 1286387 3594077 26 /usr/local/g1_3.2_SE /dev/vghome_old/lvol1 23552000 10375127 12353732 46 /usr/local/g1 /dev/vg3psw/lvol3 2097152 137104 1944800 7 /usr/local/dazel /dev/vg3psw/lvol8 1228800 302520 919104 25 /usr/local/ccmi /dev/vg3psw/lvol10 4096000 3714072 358119 91 /usr/local/TWS /dev/vgapp/lvol5 2097152 16192 2072336 1 /tuxhome /dev/vgapp02/lvol1 153616384 101215137 49155476 67 /tuxappl /dev/vg00/lvol6 1540096 36224 1496576 2 /tmp /dev/vgapp-io/lvol1 199155712 153646976 45332312 77 /tlgvar /dev/vgapp/lvol4 20971520 2912 20804800 0 /tlg /dev/vgapp/lvol2 65536000 1138720 63894248 2 /reports /dev/vgmafg/lvol1 52396032 6968 51982472 0 /pvdev /dev/vgapp/lvol6 204800 10712 192632 5 /p/sbms /dev/vgapp/lvol7 102498304 48416456 53670568 47 /p/sbms/mps /dev/vgdbcommon/lvol2 167755776 125249936 42183024 75 /oraexp /dev/vg00/lvol5 4194304 3641336 548688 87 /opt /dev/vg3psw/lvol11 3145728 527068 2455009 18 /opt/mqm /dev/vg3psw/lvol5 1048576 388952 654520 37 /opt/iona my table look like this Server_Status Name Null? Type ----------------------------------------- -------- ---------------------------- SERVER_ID NOT NULL NUMBER(6) FS_LOCAL_NAME NOT NULL VARCHAR2(200) LOCAL_MOUNT NOT NULL CHAR(1) TOTAL_SPACE NOT NULL NUMBER(10) USED_SPACE NUMBER(10) SPACE_AVAILABLE NUMBER(10) PERCENTAGE_USED NUMBER(3,2) |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|