Sponsored Content
Top Forums Shell Programming and Scripting Using sed to extract line of a file Post 303034920 by ctsgnb on Thursday 9th of May 2019 11:04:21 AM
Old 05-09-2019
Just another way to do the same

Code:
awk '/^interface/{i=$0}/helper/{ print ((i!=z)?i RS:z) $0 ; i=z }' yourfile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract a line from a file using the line number

I have a shell script and want to assign a value to a variable. The value is the line exctrated from a file using the line number. The line number it is not fix, and could change any time. I have tried sed, awk, head .. See my script # Get randome line number from the file #selectedline = `awk... (1 Reply)
Discussion started by: zambo
1 Replies

2. Shell Programming and Scripting

extract file extension using sed

Hi, how can i extract file extension using sed? for e.g., if a file name is abc.txt then how can i get "txt" (after .) Thanks praveen (7 Replies)
Discussion started by: r_praveenk
7 Replies

3. Shell Programming and Scripting

extract a line from a file using the line number

Hello, I am having trouble extracting a specific line from a file when the line number is known. My first attempt involved grep -n 'hi' (the word 'hi will always be there) to get the line number before the line that I actually want (line 4). Extra Notes: -I am working in a bash script. -The... (7 Replies)
Discussion started by: grandtheftander
7 Replies

4. UNIX for Dummies Questions & Answers

Using sed to extract a substring at end of line

This is the line that I am using: sed 's/^*\({3}*$\)/\1 /' <test.txt >results.txt and suppose that test.txt contains the following lines: http://www.example.com/200904/AUS.txt http://www.example.com/200903/_RUS.txt http://www.example.com/200902/.FRA.txt What I expected to see in results.txt... (6 Replies)
Discussion started by: figaro
6 Replies

5. Shell Programming and Scripting

get the fifth line of a text file into a shell script and trim the line to extract a WORD

FOLKS , i have a text file that is generated automatically of an another korn shell script, i want to bring in the fifth line of the text file in to my korn shell script and look for a particular word in the line . Can you all share some thoughts on this one. thanks... Venu (3 Replies)
Discussion started by: venu
3 Replies

6. Shell Programming and Scripting

Extract a number from a line in a file and sed in another copied file

Dear all, I am trying to extract a number from a line in one file (task 1), duplicate another file (task 2) and replace all instances of the strings 300, in duplicated with the extracted number (task 3). Here is what I have tried so far: for ((k=1;k<4;k++)); do temp=`sed -n "${k}p"... (2 Replies)
Discussion started by: mnaqvi
2 Replies

7. Shell Programming and Scripting

extract a line from a file by line number

Hi guys, does anyone know how to extract(grep) a line from the file, if I know the line number? Thanks a lot. (9 Replies)
Discussion started by: aoussenko
9 Replies

8. Shell Programming and Scripting

HELP: Shell Script to read a Log file line by line and extract Info based on KEYWORDS matching

I have a LOG file which looks like this Import started at: Mon Jul 23 02:13:01 EDT 2012 Initialization completed in 2.146 seconds. -------------------------------------------------------------------------------- -- Import summary for Import item: PolicyInformation... (8 Replies)
Discussion started by: biztank
8 Replies

9. Shell Programming and Scripting

sed or awk, cut, to extract specific data from line

Hi guys, I have been trying to do this, but... no luck so maybe you can help me. I have a line like this: Total Handled, Received, on queue Input Mgs: 140 / 14 => 0 I need to, get the number after the / until the =, to get only 14 . Any help is greatly appreciated. Thanks, (4 Replies)
Discussion started by: ocramas
4 Replies

10. Shell Programming and Scripting

Perl to extract information from a file line by line

In the below perl code I am using tags within each line to extract certain information. The tags that are used are: STB >0.8 is STRAND BIAS otherwise GOOD FDP is the second number GO towards the end of the line is read into an array and the value returned is outputed, in the first line that... (1 Reply)
Discussion started by: cmccabe
1 Replies
innoextract(1)						      General Commands Manual						    innoextract(1)

NAME
innoextract - tool to extract installers created by Inno Setup SYNOPSIS
innoextract [-behlLqstv] [-ccolor] [-pprogress] installers ... DESCRIPTION
innoextract is a tool that can extract installer executables created by Inno Setup. innoextract will extract files from a installers specified on the command line. To extract a multi-part installer with external data files, only the executable (.exe) file needs to be given as an argument to innoex- tract. OPTIONS
-c --color [enable] By default innoextract will try to detect if the terminal supports shell escape codes and enable or disable color output accord- ingly. Pass 1 or true to --color to force color output. Pass 0 or false to never output color codes. --dump Don't convert Windows paths to UNIX paths and don't substitute variables in paths. -e --extract Extract all files to the current directory. This is the default action. You may only specify one of --extract , --list and --test -h --help Show a list of the supported options. --language [lang] Extract only language-independent files and files for the given language. By default all files are extracted. --license Show license information. -l --list List files contained in the installer but don't extract anything. You may only specify one of --extract , --list and --test -L --lowercase Convert filenames stored in the installer to lower-case before extracting. -p --progress [enable] By default innoextract will try to detect if the terminal supports shell escape codes and enable or disable progress bar output accordingly. Pass 1 or true to --progress to force progress bar output. Pass 0 or false to never show a progress bar. -q --quiet Less verbose output. -s --silent Don't output anything except errors and warnings. -t --test Test archive integrity but don't write any output files. You may only specify one of --extract , --list and --test -v --version Show the innoextract version number and supported Inno Setup versions. LIMITATIONS
innoextract currently only supports extracting all the data. There is no support for extracting individual files, components or languages. Included scripts and checks are not executed. Data is always extracted to the current directory and the mapping from Inno Setup variables like the application directory to subdirecto- ries is hard-coded. innoextract does not check if an installer includes multiple files with the same name and will continually overwrite the destination file when extracting. Names for data files in multi-file installers must follow the standard naming scheme. Encrypted installers are not supported. SEE ALSO
cabextract(1), unshield(1) BUGS
No known bugs. AUTHOR
Daniel Scharrer (daniel@constexpr.org) 1.2 2012-04-01 innoextract(1)
All times are GMT -4. The time now is 06:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy