Sponsored Content
Full Discussion: Editing file
Top Forums Shell Programming and Scripting Editing file Post 302137185 by rahul303 on Sunday 23rd of September 2007 10:16:01 AM
Old 09-23-2007
oops...seems we are not on same page !

He JimD
Thanks for your effort ! But I think we are not on same path....!
Let me explain my requirement more simply now,...

In my file I am getting rows as like this :
Code:
1US500100010000010001920077000131973511115107128101771004460001204600004        0        0        0        0
1US500100010000010001920077000131973511115122115101771004460000889600007        0        0        0        0
1US500100010000010001920077000131973511115122115101771004460000889600848        0        0        0        0
1US500100010000010001920077000131973511115145123103111004129440199600034        0        0        0        0
1US500100010000010001920077000131973511115145123103111004129440199611798        0        0        0        0
1US500100010000010001920077000131973511115145123105731004129440254200959        0        0        0        0
1US500100010000010001920077000131973511151213161106591004460083113503316        0        0        0        0
1US500100010000010001920077000131973511151213161106591004460083246011470        0        0        0        0
1US500100010000010001920077000131973511617125150106821001258770530508226        0        0        0        0
1US500100010000010001920077000131973511617125150106821001258770530511107        0        0        0        0
1US500100010000010001920077000132240211115145123103111004129440199600034        0        0        0        0
1US500100010000010001920077000132240211115145123103111004129440199611798        0        0        0        0

(Note : kindly copy/paste above rows in notepad to get real view)
Now I need to add an extra field og length-9 after first column with NULL value.
So after editing a row should look like this:
1US500100010000010001920077000131973511115107128101771004460001204600004 0 0 0 0
i.e. <1stcolumn value><9 spaces><2nd col value>....and so on..

Let me also tell file has many rows of similar format and size of file is 24mb.

Kindly help....
Will wait for your reply.
Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Editing the end of the file without loading the entire file

hi! I am a newbee. I would really appreciate if you can answer the following question: I have a huge data file, 214MB with several coloumns. I need to delete the very last line of the file. Everything I know takes a lot of time to do it ( because I have to open the file in an editor or run a... (3 Replies)
Discussion started by: Garuda
3 Replies

2. Linux

file editing

I have created a file with vi -x (file name) this is encrypted file when i again open this file it ask me to enter a password before editing it.Can i remove this password but i don't want to delete a file how to do this. Thanks (0 Replies)
Discussion started by: ambavaram
0 Replies

3. Shell Programming and Scripting

Editing a File

Hi all, I have a file with following contents # rad124 # radkus # raddebug # radtrace I could like to remove the # and space present before the key word "rad". Any ways to do this using "subsitution method(:%s/old/new/g)" will be hepful. (1 Reply)
Discussion started by: ramkriz
1 Replies

4. Shell Programming and Scripting

file editing

how to remove duplicate word in a file ? (2 Replies)
Discussion started by: mail2sant
2 Replies

5. Shell Programming and Scripting

Help with file editing while keeping file format intact

Hi, I am having a file which is fix length and comma seperated. And I want to replace values for one column. I am reading file line by line in variable $LINE and then replacing the string. Problem is after changing value and writing new file temp5.txt, formating of original file is getting... (8 Replies)
Discussion started by: Mruda
8 Replies

6. Shell Programming and Scripting

editing line in text file adding number to value in file

I have a text file that has data like: Data "12345#22" Fred ID 12345 Age 45 Wilma Dino Data "123#22" Tarzan ID 123 Age 33 Jane I need to figure out a way of adding 1,000,000 to the specific lines (always same format) in the file, so it becomes: Data "1012345#22" Fred ID... (16 Replies)
Discussion started by: say170
16 Replies

7. Shell Programming and Scripting

Need help in editing a file

I have a file which has 10 million records in it. When am trying to edit the file with vi, the following error occurs: ~ ~ ~ ~ ~ ~ ~ ~ "file1" Value too large for defined data type Is there any way that I can edit this file without using vi? Any help would be really appreciated.... (8 Replies)
Discussion started by: bobby1015
8 Replies

8. UNIX for Dummies Questions & Answers

File editing

Hi All, I've to edit the below file in the Current File: XXX Rows found with null for one or more non-nullable columns in the source table SELECT COUNT(*) FROM ( SELECT 1 as one FROM datum WHERE:wall: datum.ID IS NULL ) a (1 Reply)
Discussion started by: udayakumar
1 Replies

9. Shell Programming and Scripting

File Editing

Never mind!. Thanks (1 Reply)
Discussion started by: smarones
1 Replies

10. Shell Programming and Scripting

Convert vi editing to text editing

Dear Guru's I'm using Putty and want to edit a file. I know we generally use vi editor to do it. As I'm not good in using vi editor, I want to convert the vi into something like text pad. Is there any option in Putty to do the same ? Thanks for your response. Srini (6 Replies)
Discussion started by: thummi9090
6 Replies
shift(1)							   User Commands							  shift(1)

NAME
shift - shell built-in function to traverse either a shell's argument list or a list of field-separated words SYNOPSIS
sh shift [n] csh shift [variable] ksh * shift [n] DESCRIPTION
sh The positional parameters from $n+1 ... are renamed $1 ... . If n is not given, it is assumed to be 1. csh The components of argv, or variable, if supplied, are shifted to the left, discarding the first component. It is an error for the variable not to be set or to have a null value. ksh The positional parameters from $n+1 $n+1 ... are renamed $1 ..., default n is 1. The parameter n can be any arithmetic expression that evaluates to a non-negative number less than or equal to $#. On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari- able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not performed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), ksh(1), sh(1), attributes(5) SunOS 5.10 15 Apr 1994 shift(1)
All times are GMT -4. The time now is 11:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy