Sponsored Content
Top Forums Shell Programming and Scripting Process multiple lines in a text file Post 302640769 by sandipjee on Tuesday 15th of May 2012 09:57:32 AM
Old 05-15-2012
Error Process multiple lines in a text file

Hi All

I have text file like this:

Code:
a=21ej
c=3tiu32
e=hydkehw
f=hgdiuw
g=jhdkj
a=klkjhvl
b=dlkjhyfd
a=yo
c=8732

Any way I can process data from first a to just before of second a, and then second a to just before of 3rd one.

Just fetching records like that will help, I mean if I can store data in a file like this.

Last edited by Scrutinizer; 05-15-2012 at 11:15 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

removing multiple lines of text in a file

Hi, I'm trying to remove multiple lines of text based off a series of different words and output it to a new file The document contains a ton of data but i want to delete any line that has the following mx1.rr.biz.com or ns2.ri.biz.com i tried using grep -v filename "mx1.rr.biz.com" >... (3 Replies)
Discussion started by: spartan22
3 Replies

2. Shell Programming and Scripting

[bash help]Adding multiple lines of text into a specific spot into a text file

I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it. For example, Here is a portion of a zone file. IN NS ns1.domain.tld. IN NS ns2.domain.tld. IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies

3. UNIX for Dummies Questions & Answers

Help please, extract multiple lines from a text file

Hi all, I need to extract lines between the lines 'RD' and 'QA' from a text file (following). there are more that one of such pattern in the file and I need to extract all of them. however, the number of lines between them is varied in the file. Therefore, I can not just use 'grep -A' command.... (6 Replies)
Discussion started by: johnshembb
6 Replies

4. UNIX for Dummies Questions & Answers

JOINING MULTIPLE LINES IN A TEXT FILE USING GAWK

sir... am having a data file of customer master., containing some important fields as a set one line after another., what i want is to have one set of these fields(rows) one after another in line.........then the second set... and so on... till the last set completed. I WANT THE DATA... (0 Replies)
Discussion started by: KANNI786
0 Replies

5. UNIX for Dummies Questions & Answers

How to generate multiple lines in a text file?

Hello, I want to create a file whose content is multiple lines of strings. The string has the following pattern: aaaa/bbbb/A-B.txt A is a variable ranges from A1 to A2 B is a variable ranges from B1 to B2 Any ideas? Thanks. (17 Replies)
Discussion started by: vic005
17 Replies

6. UNIX for Dummies Questions & Answers

print multiple lines from text file based on pattern list

I have a text file with a list of items/patterns: ConsensusfromCGX_alldays_trimmedcollapsedfilteredreadscontiglist(229095contigs)contig12238 ConsensusfromCGX_alldays_trimmedcollapsedfilteredreadscontiglist(229095contigs)contig34624... (1 Reply)
Discussion started by: Oyster
1 Replies

7. Shell Programming and Scripting

Extracting Multiple Lines from a Text File

Hello. I am sorry if this is a common question but through all my searching, I haven't found an answer which matches what I want to do. I am looking for a sed command that will parse through a large text file and extract lines that start with specific words (which are repeated throughout the... (4 Replies)
Discussion started by: MrDumbQuestion
4 Replies

8. UNIX for Dummies Questions & Answers

How to grep multiple lines from a text file using another text file?

I would like to use grep to select multiple lines from a text file using a single-column text file. Basically I want to only select lines from the first text file where the second column of the first text file matches the second text file. How do I go about doing that? Thanks! (5 Replies)
Discussion started by: evelibertine
5 Replies

9. Shell Programming and Scripting

Remove multiple lines from a text file

Hi I have a text file named main.txt with 10,000 lines. I have another file with a list of line numbers (around 1000) of the lines to be deleted from main.txt file. I tried with sed but it removes only a range of line numbers. Thanks for any help!! (1 Reply)
Discussion started by: prvnrk
1 Replies

10. Shell Programming and Scripting

Join multiple lines from text file

Hi Guys, Could you please advise how to join multiple details lines into single row, with HEADER 1 as the record separator and comma(,) as the field separator. Input: HEADER 1, HEADER 2, HEADER 3, 11,22,33, COLUMN1,COLUMN2,COLUMN3, AA1, BB1, CC1, END: ABC HEADER 1, HEADER 2,... (3 Replies)
Discussion started by: budz26
3 Replies
Plack::Session::Store::File(3pm)			User Contributed Perl Documentation			  Plack::Session::Store::File(3pm)

NAME
Plack::Session::Store::File - Basic file-based session store SYNOPSIS
use Plack::Builder; use Plack::Middleware::Session; use Plack::Session::Store::File; my $app = sub { return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello Foo' ] ]; }; builder { enable 'Session', store => Plack::Session::Store::File->new( dir => '/path/to/sessions' ); $app; }; # with custom serializer/deserializer builder { enable 'Session', store => Plack::Session::Store::File->new( dir => '/path/to/sessions', # YAML takes it's args the opposite order serializer => sub { YAML::DumpFile( reverse @_ ) }, deserializer => sub { YAML::LoadFile( @_ ) }, ); $app; }; DESCRIPTION
This implements a basic file based storage for session data. By default it will use Storable to serialize and deserialize the data, but this can be configured easily. This is a subclass of Plack::Session::Store and implements its full interface. METHODS
new ( %params ) The %params can include dir, serializer and deserializer options. It will check to be sure that the dir is writable for you. dir This is the directory to store the session data files in, if nothing is provided then "/tmp" is used. serializer This is a CODE reference that implements the serialization logic. The CODE ref gets two arguments, the $value, which is a HASH reference to be serialized, and the $file_path to save it to. It is not expected to return anything. deserializer This is a CODE reference that implements the deserialization logic. The CODE ref gets one argument, the $file_path to load the data from. It is expected to return a HASH reference. BUGS
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT. AUTHOR
Stevan Little <stevan.little@iinteractive.com> COPYRIGHT AND LICENSE
Copyright 2009, 2010 Infinity Interactive, Inc. <http://www.iinteractive.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.4 2011-07-27 Plack::Session::Store::File(3pm)
All times are GMT -4. The time now is 06:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy