Sponsored Content
Full Discussion: Editing long text file
Top Forums UNIX for Dummies Questions & Answers Editing long text file Post 302974703 by James C on Thursday 2nd of June 2016 12:12:25 PM
Old 06-02-2016
Editing long text file

Good morning all, I have a machine running IRIX and I need to edit a text file on the terminal that is literally thousands of lines. Does anyone know the most efficient way to edit portions of files like these? Obviously simply using the vi command isn't going to work since I get a too many lines error. Thanks a lot, James
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Text Editing

Hello everybody, I have a sorted text file. some of the lines appear twice or even more. is there an unix utility that removes the extra appearences? Thanks, Ido. (7 Replies)
Discussion started by: ginodii
7 Replies

2. Shell Programming and Scripting

How do I strip and add tabbed fields to a long text file?

I was wondering if there was a way to modify a tab delimited text file, up to 185,000 lines long by adding a repeated field to a block of 20 data , then repeat the process until the file is processed. The current file looks like: ... (3 Replies)
Discussion started by: saint65
3 Replies

3. Shell Programming and Scripting

text file editing

Hi, I need some help in text manipulation. I have an input file like this: 7629 "WPCW 19 - CW/AM1, WPCB 40 - FAMN/CORNER, WPCB-DT1 50 - FAMN/CORNER, " W35AW - Various Shopping Pgms W41CF - TBN W47CV - TBN WLLS-LP 49 - AM1 WATCH WPXI 11 N & WPIX 11 CW 1234 "WPCW 19 - CW/AM1,... (26 Replies)
Discussion started by: injeti
26 Replies

4. Shell Programming and Scripting

Editing long records with characters that need to be escaped.

Hi all, I'm new in unix scripting and I've a problem with a script... :confused: I need to read a file, add some fields in the records, and write them in another file, but even when I simply read and write the records, the shell interprets some caracters and the result is that the records... (5 Replies)
Discussion started by: Macs_Linux
5 Replies

5. Shell Programming and Scripting

Text editing script does everything but edit text.

I wrote this script to create and edit a large number of websites based on a template site and a collection of text files which have the relevant strings in them delimited by colons. I run it and the shell doesn't produce any errors, but when it gets to the for loop where it actually has to edit... (2 Replies)
Discussion started by: afroCluster
2 Replies

6. Programming

Editing a specific liine of text file - C++

Is there any way to erase all the contents of a specific line of a text file and then write something on it? e.g. test.txt.old: qwert asdfg zxcbv=0 test.txt.new qwerty asdfg hello=0 is this possible with C++ ?:confused: (1 Reply)
Discussion started by: hakermania
1 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

Help needed editing text file using the terminal

Hi, I have text file with the header like this tracking_id condition replicate FPKM XLOC_000001 alpha 1 10.3199 XLOC_000001 alpha 0 10.3686 XLOC_000001 alpha 2 15.5619 ... With the first column being genes, the second being the condition, the third... (5 Replies)
Discussion started by: 4galaxy7
5 Replies

9. 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
diff3(1)						      General Commands Manual							  diff3(1)

NAME
diff3 - Compares three files SYNOPSIS
diff3 [-e | -x | -E | -X | -3] file1 file2 file3 The diff3 command reads three versions of a file and writes to standard output the ranges of text that differ. OPTIONS
Creates an edit script for use with the ed command to incorporate into file1 all changes between file2 and file3 (that is, the changes that normally would be flagged ==== and ====3). Produces an edit script to incorporate only changes flagged ====. These are similar to -e and -x, respectively, but treat overlapping changes (that is, changes that are flagged ==== in the normal listing) differently. The overlap- ping lines from both files are inserted by the edit script, bracketed by <<<<<< and >>>>>> lines. The -E option is used by RCS merge to ensure that overlapping changes in the merged files are preserved and brought to someone's attention. Produces an edit script to incorpo- rate only changes flagged ====3. DESCRIPTION
The diff3 command reads three versions of a file and writes to standard output the ranges of text that differ, flagged with the following codes: All three files differ. file1 differs. file2 differs. file3 differs. The type of change needed to convert a given range of a given file to match another file is indicated in one of these two ways in the out- put: Text is to be added after line number number1 in file, where file is 1, 2, or 3. Text in the range line number1 to line number2 is to be changed. If number1 = number2, the range may be abbreviated to number1. The original contents of the range follow immediately after a c indication. When the contents of two files are identical, diff3 does not show the contents of the lower-numbered file, although it shows the location of the identical lines for each. NOTES
Editing scripts produced by the -e option cannot create lines consisting only of a single . (dot). EXAMPLES
To list the differences among three files, enter: diff3 fruit.a fruit.b fruit.c fruit.a, fruit.b, and fruit.c contain the following data: fruit.a: banana grape kiwi lemon mango orange peach pare fruit.b: apple banana grapefruit kiwi orange peach pear fruit.c: grape grapefruit kiwi lemon mango orange peach pear The output from diff3 shows the differences between these files as follows. (The comments on the right do not appear in the output.) ==== All three files are different. 1:1,2c - Lines 1 and 2 of the first file, fruit.a banana grape 2:1,3c - Lines 1 through 3 of fruit.b apple banana grapefruit 3:1,2c - Lines 1 and 2 of fruit.c grape grapefruit ====2 The second file, fruit.b, is different. 1:4,5c - Lines 4 and 5 are the same in fruit.a and fruit.c. 2:4a 3:4,5c - To make fruit.b look the same, add text after line 4. lemon mango ====1 The first file, fruit.a, is different. 1:8c pare 2:7c - Line 7 of fruit.b and line 8 of fruit.c are the same. 3:8c pear FILES
Helper program. SEE ALSO
Commands: bdiff(1), cmp(1), comm(1), diff(1), ed(1) diff3(1)
All times are GMT -4. The time now is 03:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy