Sponsored Content
Full Discussion: Add new column in Text File
Top Forums Shell Programming and Scripting Add new column in Text File Post 302288222 by pareshan on Monday 16th of February 2009 06:18:51 PM
Old 02-16-2009
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
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to get First column from the text file

Hey Guys, I have a very urgent requirement regaridng the searching for value on the text file. The text file is in the below format Number Description "112323", mysampletest1 "12122412", mysampletest2 "11232143", mysampletest3 I need to get the first column like 112323... (2 Replies)
Discussion started by: rahman_riyaz
2 Replies

2. UNIX for Dummies Questions & Answers

Replacing a column in a text file

Say I had a text file that contained four columns, like the following: Mack Christopher:237 Avondale Blvd:970-791-6419:S Ben Macdonor:30 Dragon Rd:647-288-6395:B I'm making a loop that will replace the fourth column a line in the file with the contents of a variable 'access', but I have no... (6 Replies)
Discussion started by: Sotau
6 Replies

3. Shell Programming and Scripting

Finding the last column value from a text file

Hi, I need to find out the last column value from a text file which is delimited by a tab. The issue here is the last column# for each record can be different i.,e, 1st record can have the last column as 15 and the second record can have the last column as "17". I have to search a string... (3 Replies)
Discussion started by: naveen_sangam
3 Replies

4. UNIX for Dummies Questions & Answers

Add a new column to a tab delimited text file

I want to add a new column to a tab delimited text file. It will be the first column and it will just be 1's. How do I go about doing that? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

5. UNIX for Dummies Questions & Answers

Replacing a specific column of a text file with another column

I have a text file in the following format: 13412 NA06985 0 0 2 46.6432798439 4 4 4 4 13412 NA06991 NA06993 NA06985 2 48.8478948517 4 4 2 4 13412 NA06993 0 0 1 45.8022601455 4 4 2 4 13401 NA06994 0 0 1 48.780669145 4 4 4 4 13401 NA07000 0 0 2 47.7312017846 2 4 4 4 13402 NA07019... (3 Replies)
Discussion started by: evelibertine
3 Replies

6. UNIX for Dummies Questions & Answers

Replacing a specific column of a text file with another column

Hi, I have a text file in the following format: Code: 13412 NA06985 0 0 2 46.6432798439 4 4 4 4 13412 NA06991 NA06993 NA06985 2 48.8478948517 4 4 2 4 13412 NA06993 0 0 1 45.8022601455 4 4 2 4 13401 NA06994 0 0 1 48.780669145 4 4 4 4 13401 NA07000 0 0 2 47.7312017846 2 4 4 4 ... (2 Replies)
Discussion started by: evelibertine
2 Replies

7. UNIX for Dummies Questions & Answers

Extracting the last column of a text file

I would like to extract the last column of a text file but different rows of the text file have different numbers of columns. How do I go about doing that? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

8. Shell Programming and Scripting

Howto add a constant column to the text file

Hi, I am converting a .DBF file to pipe delimited file my requirement is like lets say my .DBF is residing in path /a/b/c/d/f/abc.DBF I need my .txt file as having a column with source _cd =f sample data in .DBF in folder "f" c1 c2 c3 1 2 3 in txt file it should be... (4 Replies)
Discussion started by: angel12345
4 Replies

9. UNIX for Dummies Questions & Answers

Add a column of 0's to a text file

Hi, I have a text file with many column (1,000,000+). I want to add a column of 0's as the third column. I tried: awk '{$3=0}1' input file > output file But it simply replaces the third column with 0's instead of adding a new column. How do I go about doing this? Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies

10. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies
vxdestroy_lvmroot(1M)													     vxdestroy_lvmroot(1M)

NAME
vxdestroy_lvmroot - remove LVM root disk and associated LVM volume group SYNOPSIS
vxdestroy_lvmroot [-v] [-b] lvm_root_disk DESCRIPTION
The vxdestroy_lvmroot command tears down and removes the LVM volume group associated with the specified physical disk. This is done by removing the volumes in the volume group and then removing the volume group. OPTIONS
-b Invokes the setboot command to change the primary boot disk to the VxVM root disk from which the system was booted (if the pri- mary boot disk is not already set to this disk). The alternate boot device remains unchanged. If the -v option is also speci- fied, the settings of the primary and alternate boot devices are displayed. -v Outputs verbose messages including a timestamp that indicates major operations being performed. ARGUMENTS
lvm_root_disk Specifies the device name of the LVM root disk that is to be destroyed, along with its entire volume group. EXAMPLES
This example shows the vxdestroy_lvmroot command invoked in its simpliest form: /etc/vx/bin/vxdestroy_lvmroot c5t1d0 # /etc/vx/bin/vxdestroy_lvmroot -v -b c3t0d0 Are you sure about destroying c3t0d0 (imported on VG /dev/vg02) ? YES vxdestroy_lvmroot 06:02: Tearing down /dev/vg02 on device c3t0d0 vxdestroy_lvmroot 06:02: Unmounting and removing any volumes associated with /dev/vg02 vxdestroy_lvmroot 06:02: removing logical volume /dev/vg02/lvol1 vxdestroy_lvmroot 06:02: removing logical volume /dev/vg02/lvol2 vxdestroy_lvmroot 06:02: removing logical volume /dev/vg02/lvol3 vxdestroy_lvmroot 06:02: removing logical volume /dev/vg02/lvol4 vxdestroy_lvmroot 06:02: removing logical volume /dev/vg02/lvol5 vxdestroy_lvmroot 06:02: removing logical volume /dev/vg02/lvol6 vxdestroy_lvmroot 06:02: removing logical volume /dev/vg02/lvol7 vxdestroy_lvmroot 06:02: removing logical volume /dev/vg02/lvol8 vxdestroy_lvmroot 06:02: Removing Volume Group /dev/vg02 vxdestroy_lvmroot 06:02: Removing device files in /dev/vg02 vxdestroy_lvmroot 06:02: Removing LVM Physical Volume c3t0d0 vxdestroy_lvmroot 06:02: Removing LVM Physical Volume c1t1d3 vxdestroy_lvmroot 06:02: Removing LVM Physical Volume c1t1d4 vxdestroy_lvmroot 06:02: Removing LVM Physical Volume c1t1d5 vxdestroy_lvmroot 06:03: Current setboot values: vxdestroy_lvmroot 06:03: Primary: 0/0/6/0/0.0.0 vxdestroy_lvmroot 06:03: Alternate: 0/0/1/0/0.1.0 vxdestroy_lvmroot 06:03: Making disk c0t1d0 (0/0/1/0/0.1.0) the primary boot disk vxdestroy_lvmroot 06:03: Removal of device c3t0d0, volume group /dev/vg02 was successful SEE ALSO
cpio(1), dd(1), fsck(1M), setboot(1M) vxbootsetup(1M) vxcp_lvmroot(1M) vxres_lvmroot(1M) VxVM 5.0.31.1 24 Mar 2008 vxdestroy_lvmroot(1M)
All times are GMT -4. The time now is 12:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy