Sponsored Content
Full Discussion: Help editing a file
Top Forums Shell Programming and Scripting Help editing a file Post 21743 by Perderabo on Wednesday 22nd of May 2002 08:33:34 AM
Old 05-22-2002
Spaces are not a problem. All we need is for the line to start with one of the correct sequences and then to have 1902 anywhere in the line as a contiguous sequence. By using quoting I was able to recover your spaces and produced your original line. It is so long that I inserted backslash/newlines combos to shorten it for posting:

Code:
AA0GAA11-030                ASY960000336ABDUL BARI MD                    618 5TH AVENUE\
                                              CAIRO               GA31728         BARBARA\
 GROOMS                   229377709019020516053400                C00200     PROD

But I tested it all joined together as a single long line. That also worked. Nulls are another matter. I have no way to recover any nulls in your line. And the presence of nulls indicates that we do not have a text file. Sed may indeed fail if you really have nulls in the line. Ditto for any other text processing tool. If you have binary data to edit a c program my be your only option. Send of of your lines through "od -c" and post the result so we can see what we are actually dealing with. Maybe someone will have an idea...
 

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. Shell Programming and Scripting

Editing file

Hi, I am in a situation wherein am getting file file certailn values suppose 1u56979hhghhklklkkkjkjkjk 0 0 0 The file will have values like above only. I need to add another field of NULL value(of length 9) at the end of first column i.e. It should like this after editing:... (4 Replies)
Discussion started by: rahul303
4 Replies

3. 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

4. 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

5. Shell Programming and Scripting

file editing

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

6. 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

7. 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

8. 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

9. 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

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
GENCAT(1)						    BSD General Commands Manual 						 GENCAT(1)

NAME
gencat -- NLS catalog compiler SYNOPSIS
gencat output-file input-files... DESCRIPTION
The gencat utility merges the text NLS input files input-files... into a formatted message catalog file output-file. The file output-file will be created if it does not already exist. If output-file does exist, its messages will be included in the new output-file. If set and message numbers collide, the new message text defined in input-files... will replace the old message text currently contained in output-file. INPUT FILES
The format of a message text source file is defined below. Note that the fields of a message text source line are separated by a single space character: any other space characters are considered to be part of the field contents. $set n comment This line specifies the set identifier of the following messages until the next $set or end-of-file appears. The argument n is the set identifier which is defined as a number in the range [1, (NL_SETMAX)]. Set identifiers must occur in ascending order within a single source file, but need not be contiguous. Any string following a space following the set identifier is treated as a comment. If no $set directive is specified in a given source file, all messages will be located in the default message set NL_SETD. $del n comment This line deletes messages from set n from a message catalog. The n specifies a set number. Any string following a space following the set number is treated as a comment. $ comment A line beginning with $ followed by a space is treated as a comment. m message-text A message line consists of a message identifier m in the range [1, (NL_MSGMAX)]. The message-text is stored in the message catalog with the set identifier specified by the last $set directive, and the message identifier m. If the message-text is empty, and there is a space character following the message identifier, an empty string is stored in the message catalog. If the message-text is empty, and if there is no space character following the message identifier, then the existing message in the current set with the specified message identifier is deleted from the catalog. Message identifiers must be in ascending order within a single set, but need not be contiguous. The message-text length must be in the range [0, (NL_TEXTMAX)]. $quote c This line specifies an optional quote character c which can be used to surround message-text so that trailing space or empty messages are visible in message source files. By default, or if an empty $quote directive is specified, no quoting of message-text will be rec- ognized. Empty lines in message source files are ignored. The effect of lines beginning with any character other than those described above is unde- fined. Text strings can contain the following special characters and escape sequences. In addition, if a quote character is defined, it may be escaped as well to embed a literal quote character. line feed horizontal tab v vertical tab  backspace carriage return f form feed \ backslash ooo octal number in the range [000, 377] A backslash character immediately before the end of the line in a file is used to continue the line onto the next line, e.g.: 1 This line is continued on this line. If the character following the backslash is not one of those specified, the backslash is ignored. DIAGNOSTICS
The gencat utility exits 0 on success, and >0 if an error occurs. SEE ALSO
catclose(3), catgets(3), catopen(3) STANDARDS
The gencat utility is compliant with the X/Open Portability Guide Issue 4 (``XPG4'') standard. AUTHORS
This manual page was originally written by Ken Stailey and later revised by Terry Lambert. BUGS
A message catalog file created from a blank input file cannot be revised; it must be deleted and recreated. BSD
June 11, 1997 BSD
All times are GMT -4. The time now is 06:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy