08-11-2009
Replacing second line from huge files
I'm trying simple functionality of replacing the second line of files with some other string.
Problem is these files are huge and there are too many files to process.
Could anyone please suggest me a way to replace the second line of all files with another text in a fastest possible manner.
existing line:
<ase:aseXML xmlns:ase="urn:aseXML:r22" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:aseXML:r22 http://www.nemmco.com.au/aseXML/schemas/r22/aseXML_r22.xsd">
New line required:
<ase:aseXML xmlns:ase="urn:aseXML:r22" xmlns:xsi="/dstage/data/CISdev/MSATS/Schema/XMLSchema-instance.xml" xsi:schemaLocation="urn:aseXML:r22 /dstage/data/CISdev/MSATS/Schema/aseXML_r22.xsd">
Regards
Satish
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hello,
I need to insert a line (like a header) as the first line of a very huge file (about 3 ml rows). I am able to do it with sed, but redirecting the output and creating a new file takes quite some time. I was wondering if there was a more efficient way of doing it?
Any help would be... (3 Replies)
Discussion started by: shriek
3 Replies
2. UNIX for Dummies Questions & Answers
i need help..!!!!
i have one big text file estimate data file size 50 - 100GB with 70 Mega Rows.
on OS SUN Solaris version 8
How i can remove first line of the text file.
Please suggest me for solutions.
Thank you very much in advance:) (5 Replies)
Discussion started by: madoatz
5 Replies
3. Shell Programming and Scripting
I got a file named as data_file
Contents of data_file got about IGB reads.
The contents look like below:
+ABC_01
AABBCCDDEEFFPPOOLLKK
-ABC_01
hhhhhhhhhhhhhhhhhhhhh
+ACB_100
APPPPPPPPPPIIIPPOOLLKK
-ACB_100
hhhhhhhhhhHHHHHHHIhhh
+AEF_55
CCCCPPPCQQFFPPOOLLKK
-AEF_55
WEEGFVShhhhhhhhhhhhPP... (7 Replies)
Discussion started by: patrick87
7 Replies
4. Shell Programming and Scripting
Hi, all:
I've got two folders, say, "folder1" and "folder2".
Under each, there are thousands of files.
It's quite obvious that there are some files missing in each. I just would like to find them. I believe this can be done by "diff" command.
However, if I change the above question a... (1 Reply)
Discussion started by: jiapei100
1 Replies
5. Shell Programming and Scripting
Hi,
I am having 2 huge files having line count more than 10million. The files look like:
File 1
45905099 2059
942961505 3007
8450875165 7007
615565331 3015
9415586035 9012
9871573 5367
4415655 4011
44415539519 5361
3250659295 4001
5950718618 9367
File 2
44415539519 TQ03... (2 Replies)
Discussion started by: rochitsharma
2 Replies
6. Shell Programming and Scripting
I have huge text files (~120 MB)x100 which equivalents to ~11GB of data. The files contain pure numbers, actually the value of "phi" to 10 billion digits!!
I know its huge!! Here are the last few lines of a file
0952899155 3233967444 3344925499 0276061529 7261968933 9683989044 3317145063... (14 Replies)
Discussion started by: shantanuthatte
14 Replies
7. Shell Programming and Scripting
Hi,
I need to correct line breaks for huge files (more than 1MM records in a file) and then format it properly.
Except the header and trailer, each record starts with 'D'.
Requirement:Scan the whole file except the header and trailer records and see if any of the records start with... (19 Replies)
Discussion started by: kikionline
19 Replies
8. Shell Programming and Scripting
We have a huge file which has just one really large line; about 500 MB. I want to
1. Count all the occurrences of a phrase
2. Replace the phrase with another.
Trying to open it using vi has not helped as it complains that it is too large. Can any script help? Please advise.
Thank you, (12 Replies)
Discussion started by: kaushikadya
12 Replies
9. UNIX for Dummies Questions & Answers
Hi ,
I would like to replace new line characters(\n) in a huge file of about 2 million records . I tried this one (:%s/\n//g) but it's hanging there and no result. Does this command do not work if the file is big. Please let me know if you have any other options
Regards
Raj (1 Reply)
Discussion started by: rajeevm
1 Replies
10. Shell Programming and Scripting
Hi.
Pardon me if I'm posting a duplicate thread but..
I have a text file with over 150 Million records, file size is in the range if MB(close to GB).
The requirement is to read ALL the lines excepting the FIRST LINE which is the file header and the LAST LINE which is it's trailer record.
... (8 Replies)
Discussion started by: kumarjt
8 Replies
bdiff(1) User Commands bdiff(1)
NAME
bdiff - big diff
SYNOPSIS
bdiff filename1 filename2 [n] [-s]
DESCRIPTION
bdiff is used in a manner analogous to diff to find which lines in filename1 and filename2 must be changed to bring the files into agree-
ment. Its purpose is to allow processing of files too large for diff. If filename1 (filename2) is -, the standard input is read.
bdiff ignores lines common to the beginning of both files, splits the remainder of each file into n-line segments, and invokes diff on cor-
responding segments. If both optional arguments are specified, they must appear in the order indicated above.
The output of bdiff is exactly that of diff, with line numbers adjusted to account for the segmenting of the files (that is, to make it
look as if the files had been processed whole). Note: Because of the segmenting of the files, bdiff does not necessarily find a smallest
sufficient set of file differences.
OPTIONS
n The number of line segments. The value of n is 3500 by default. If the optional third argument is given and it is numeric, it is
used as the value for n. This is useful in those cases in which 3500-line segments are too large for diff, causing it to fail.
-s Specifies that no diagnostics are to be printed by bdiff (silent option). Note: However, this does not suppress possible diagnos-
tic messages from diff, which bdiff calls.
USAGE
See largefile(5) for the description of the behavior of bdiff when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes).
FILES
/tmp/bd?????
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWesu |
+-----------------------------+-----------------------------+
|CSI |enabled |
+-----------------------------+-----------------------------+
SEE ALSO
diff(1), attributes(5), largefile(5)
DIAGNOSTICS
Use help for explanations.
SunOS 5.10 14 Sep 1992 bdiff(1)