Sponsored Content
Top Forums Shell Programming and Scripting Pick a line in file 2 basing on array in file1 Post 302856843 by paresh n doshi on Wednesday 25th of September 2013 12:59:22 AM
Old 09-25-2013
Than you. This worked. But one thing I wanted to know,
my code looks fine, but returns nothing. If someone can help me
understand how array is handled here, it will help me with other such
situations as well.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split a binary file into 2 basing on 2 delemiter string

Hi all, I have a binary file (orig.dat) and two special delimiter strings 'AAA' and 'BBB'. My binary file's content is as follow: <Data1.1>AAA<Data1.2>BBB <Data2.1>AAA<Data2.2>BBB ... <DataN.1>AAA<DataN.2>BBB DataX.Y might have any length, and contains any kind of special/printable... (1 Reply)
Discussion started by: Averell
1 Replies

2. Shell Programming and Scripting

cat file1 read line-per-line then grep -A 15 lines down in fileb

STEP 1 # Set variable FILE=/tmp/mainfile SEARCHFILE =/tmp/searchfile # THIS IS THE MAIN FILE. cat /tmp/mainfile Interface Ethernet0/0 "outside", is up, line protocol is up Hardware is i82546GB rev03, BW 100 Mbps Full-Duplex(Full-duplex), 100 Mbps(100 Mbps) MAC address... (6 Replies)
Discussion started by: irongeekio
6 Replies

3. Shell Programming and Scripting

Compare multiple fields in file1 to file2 and print line and next line

Hello, I have two files that I need to compare and print out the line from file2 that has the first 6 fields matching the first 6 fields in file1. Complicating this are the following restrictions 1. file1 is only a few thousand lines at most and file2 is greater than 2 million 2. I need to... (7 Replies)
Discussion started by: gillesc_mac
7 Replies

4. UNIX for Advanced & Expert Users

how do you parse 1 line at a time of file1 ie. line(n) each line into new file

File 1 <html>ta da....unique file name I want to give file=>343...</html> <html>da ta 234 </html> <html>pa da 542 </html> and so on... File 2 343 234 542 and so on, each line in File 1 one also corresponds with each line in File 2 I have tried several grep, sed, while .. read, do,... (4 Replies)
Discussion started by: web_developer
4 Replies

5. Shell Programming and Scripting

Split a single file into several others basing on the last column

Hi folks, Happy new year. I have a file 'filename' that i wd like to split basing on the contents in the last column. The 'filename' content looks like 256772744788,9,11 256772744805,9,11 256772744792,9,11 256775543055,10,12 256782625357,9,12 256772368953,10,13 256772627735,10,13... (3 Replies)
Discussion started by: jerkesler
3 Replies

6. UNIX Desktop Questions & Answers

awk to pick out more than one line

This really is a dummy question but I'm stuck and out of time... I have a large file and out of it I only want to pick out lines starting with either "Pressure" or "N". I still need these lines to be in their original order. example of text Pressure 3 N 2 N 3 bla bla bla bla Pressure 4... (3 Replies)
Discussion started by: jenjen_mt
3 Replies

7. Shell Programming and Scripting

Replacing line 'i' of file1 with line 'j' of file 2

Hi All, As mentioned in the title I have two text files and I would like to replace line number 5 of file #1 with line number 4 of file #2 e.g. file 1 wqwert 4.4464002 3 319 286 369 46.320002 56.150002 45.100002 1 1 1 0.723 (12 Replies)
Discussion started by: f_o_555
12 Replies

8. Shell Programming and Scripting

Pick a card from an array in bash

Hello, I am trying to use $RANDOM to pick cards from an array in bash. I created the script below to give me a selection everytime I run it, but the output is always like this: 2 3 4 5 6 7 8 9 10 Jack Queen King Ace of Clubs Diamonds Hearts Spades. Can you please help me? I expected it to... (2 Replies)
Discussion started by: Pouchie1
2 Replies

9. Shell Programming and Scripting

Using regex's from file1, print line and line after matches in file2

Good day, I have a list of regular expressions in file1. For each match in file2, print the containing line and the line after. file1: file2: Output: I can match a regex and print the line and line after awk '{lines = $0} /Macrosiphum_rosae/ {print lines ; print lines } ' ... (1 Reply)
Discussion started by: pathunkathunk
1 Replies

10. UNIX for Dummies Questions & Answers

Deleting file basing on the timestamp substring in the file name

Hello, I have in my backup folder, files with names convention like this : randomFileNames_13-02-2014_23h13m09+1392333189 randomFileNames_14-02-2014_02h13m09+1392343989 randomFileNames_14-02-2014_04h13m09+1392351189 etc.... Base on timestamp at end of the filename, I would to delete all the... (7 Replies)
Discussion started by: thuyetti
7 Replies
JE::Scope(3pm)						User Contributed Perl Documentation					    JE::Scope(3pm)

NAME
JE::Scope - JavaScript scope chain (what makes closures work) DESCRIPTION
JavaScript code runs within an execution context which has a scope chain associated with it. This class implements this scope chain. When a variable is accessed the objects in the scope chain are searched till the variable is found. A JE::Scope object can also be used as global (JE) object. Any methods it does not understand will be delegated to the object at the bottom of the stack (the far end of the chain), so that "$scope->null" means the same thing as "$scope->[0]->null". Objects of this class consist of a reference to an array, the elements of which are the objects in the chain (the first element being the global object). (Think of it as a stack.) METHODS
find_var($name, $value) find_var($name) This method searches through the scope chain, starting at the end of the array, until it finds the variable named by the first argument. If the second argument is present, it sets the variable. It then returns an lvalue (a JE::LValue object) that references the variable. new_var($name, $value) new_var($name) This method creates (and optionally sets the value of) a new variable in the variable object (the same thing that JavaScript's "var" keyword does) and returns an lvalue. The variable object is the first object in the scope chain (searching from the top of the stack) that is a call object, or "$scope->[0]" if no call object is found. CONSTRUCTOR
None. Just bless an array reference. You should not need to do this because it is done for you by the "JE" and "JE::Object::Function" classes. SEE ALSO
JE JE::LValue JE::Object::Function perl v5.14.2 2012-03-18 JE::Scope(3pm)
All times are GMT -4. The time now is 02:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy