Sponsored Content
Top Forums Shell Programming and Scripting NAWK array to store lines from huge file Post 302396997 by radoulov on Saturday 20th of February 2010 09:41:18 AM
Old 02-20-2010
Yes. If you need more help please post sample input data and an example of the desired output.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete lines from huge file

I have to delete 1st 7000 lines of a file which is 12GB large. As it is so large, i can't open in vi and delete these lines. Also I found one post here which gave solution using perl, but I don't have perl installed. Also some solutions were redirecting the o/p to a different file and renaming it.... (3 Replies)
Discussion started by: rahulrathod
3 Replies

2. UNIX for Dummies Questions & Answers

How to store the values in a file into an array

Hi, I do have a file and the contents are as follws: 10 20 30 40 50 Now I want to store those values into an array. How can be done this ?? (3 Replies)
Discussion started by: risshanth
3 Replies

3. Shell Programming and Scripting

Prase a file and store and result to an array

Dear all, I have a file having the following formats: ThreadFail=Web1=1234 ThreadFail=Web2=2345 ThreadFail=Web3=12 ConnectionFail=DB1=11 ConnectionFail=DB2=22 The number of lines will be different from every time . How can I parse the file and store the result to an a array inside... (6 Replies)
Discussion started by: youareapkman
6 Replies

4. UNIX for Dummies Questions & Answers

copy and paste certain many lines of huge file in linux

Dear All, I am working with windoes OS but remote a linux machine. I wonder the way to copy an paste some part of a huge file in linux machine. the contain of file like as follow: ... dump annealling all custom 10 anneal_*.dat id type x y z q timestep 0.02 run 200000 Memory... (2 Replies)
Discussion started by: ariesto
2 Replies

5. Shell Programming and Scripting

Most reliable way to store file contents in an array in bash

Hi Guys, I have a file which has numbers in it separated by newlines as follows: 1.113 1.456 0.556 0.021 -0.541 -0.444 I am using the following code to store these in an array in bash: FILE14=data.txt ARRAY14=(`awk '{print}' $FILE14`) (6 Replies)
Discussion started by: npatwardhan
6 Replies

6. Shell Programming and Scripting

Store all the passed arguments in an array and display the array

Hi I want to write a script which store all the parameters passed to the script into an array. Once it is stored I want scan through the array and and delete those files for last month present inside the directory. The files in directory is appneded with YYYY_MM_DD. I want to know how can I... (3 Replies)
Discussion started by: dgmm
3 Replies

7. UNIX for Advanced & Expert Users

In a huge file, Delete duplicate lines leaving unique lines

Hi All, I have a very huge file (4GB) which has duplicate lines. I want to delete duplicate lines leaving unique lines. Sort, uniq, awk '!x++' are not working as its running out of buffer space. I dont know if this works : I want to read each line of the File in a For Loop, and want to... (16 Replies)
Discussion started by: krishnix
16 Replies

8. Shell Programming and Scripting

how to split a huge file by every 100 lines

into small files. i need to add a head.txt and tail.txt into small files at the begin and end, and give a name as q1.xml q2.xml q3.xml .... thank you very much. (2 Replies)
Discussion started by: dtdt
2 Replies

9. Shell Programming and Scripting

splitting a huge line of file into multiple lines with fixed number of columns

Hi, I have a huge file with a single line. But I want to break that line into lines of with each line having five columns. My file is like this: code: "hi","there","how","are","you?","It","was","great","working","with","you.","hope","to","work","you." I want it like this: code:... (1 Reply)
Discussion started by: rajsharma
1 Replies

10. Shell Programming and Scripting

Store values from a file into an array variable in Shell

Dear All, I have been trying to do a simple task of extracting 2 fields from the file (3 rows) and store it in an array variable. I tried with: #! /bin/bash ch=`cut -f10 tmp.txt` counter=0 for p in $pid do c=${ch} echo "$c ..$counter" counter=$((counter+1))... (2 Replies)
Discussion started by: ezhil01
2 Replies
Mail::Message::Construct::Read(3pm)			User Contributed Perl Documentation		       Mail::Message::Construct::Read(3pm)

NAME
Mail::Message::Construct::Read - read a Mail::Message from a file handle SYNOPSIS
my $msg1 = Mail::Message->read(*STDIN); my $msg2 = Mail::Message->read(@lines); DESCRIPTION
When complex methods are called on a "Mail::Message" object, this package is autoloaded to support the reading of messages directly from any file handle. METHODS
Constructing a message Mail::Message->read(FILEHANDLE|SCALAR|REF-SCALAR|ARRAY-OF-LINES, OPTIONS) Read a message from a FILEHANDLE, SCALAR, a reference to a SCALAR, or a reference to an array of LINES. Most OPTIONS are passed to the new() of the message which is created, but a few extra are defined. Please have a look at build() and buildFromBody() before thinking about this "read" method. Use this "read" only when you have a file- handle like STDIN to parse from, or some external source of message lines. When you already have a separate set of head and body lines, then "read" is certainly not your best choice. Some people use this method in a procmail script: the message arrives at stdin, so we only have a filehandle. In this case, you are stuck with this method. The message is preceded by a line which can be used as message separator in mbox folders. See the example how to handle that one. This method will remove "Status" and "X-Status" fields when they appear in the source, to avoid the risk that these fields accidentally interfere with your internal administration, which may have security implications. -Option --Default body_type undef strip_status_fields <true> body_type => CLASS Force a body type (any specific implementation of a Mail::Message::Body) to be used to store the message content. When the body is a multipart or nested, this will be overruled. strip_status_fields => BOOLEAN Remove the "Status" and "X-Status" fields from the message after reading, to lower the risk that received messages from external sources interfere with your internal administration. If you want fields not to be stripped (you would like to disable the stripping) you probably process folders yourself, which is a Bad Thing! example: my $msg1 = Mail::Message->read(*STDIN); my $msg2 = Mail::Message->read(@lines, log => 'PROGRESS'); $folder->addMessages($msg1, $msg2); my $msg3 = Mail::Message->read(<<MSG); Subject: hello world To: you@example.com # warning: empty line required !!! Hi, greetings! MSG # promail example my $fromline = <STDIN>; my $msg = Mail::Message->read(*STDIN); my $coerced = $mboxfolder->addMessage($msg); $coerced->fromLine($fromline); SEE ALSO
This module is part of Mail-Box distribution version 2.105, built on May 07, 2012. Website: http://perl.overmeer.net/mailbox/ LICENSE
Copyrights 2001-2012 by [Mark Overmeer]. For other contributors see ChangeLog. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.14.2 2012-05-07 Mail::Message::Construct::Read(3pm)
All times are GMT -4. The time now is 04:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy