Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Extract a portion of string from each line in Linux Post 303017652 by Don Cragun on Saturday 19th of May 2018 10:40:41 PM
Old 05-19-2018
To get back the leading double-quote character on the field that starts with "delete": in the output, I think you want to change the line:
Code:
                 print $1, substr (TMP, 2)

in RudiC's suggested code to:
Code:
                 print $1, TMP

or change the line:
Code:
                {for (i=2; i<=NF; i++) for (t in TGT) if ($i ~ t) TMP = TMP (TMP?",":"") $i

to:
Code:
                {for (i=2; i<=NF; i++) for (t in TGT) if ($i ~ t) TMP = TMP "," $i

This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to extract a portion of a string from the whole string

How to extract a portion of a string from a full string using unix. For example: Say source string is = "req92374923.log" I want only the numeric portion of the string say "92374923" how to do that in Unix. (2 Replies)
Discussion started by: ds_sastry
2 Replies

2. Shell Programming and Scripting

extract a portion of log file

hello, I want to grep the log file according to time and get the portion of log from one particular time to other. I can grep for individual lines by time but how should I print lines continuously from given start time till end till given end time. Appreciate your ideas, Thanks chandra (8 Replies)
Discussion started by: chandra004
8 Replies

3. Shell Programming and Scripting

extract date portion from file

Hi, I have a file where there is a date field (single line variable length file) how to extract just the date portion from it the position of date field may vary anywhere in the line but will always have the format mm-dd-yyyy for eg . xxxxxxxxxxxxxxx09-10-2006xxxxxxxxxxxxxxxxxxxx (5 Replies)
Discussion started by: misenkiser
5 Replies

4. Shell Programming and Scripting

how to extract a string value from the given line

Hi I have an input as follows: param1:value1|param2:value2|param3:value3|param4:value4|param5:value5 where, "|" and ":" are delimiters Now suppose, I want to extract the value corresponding to "param4", i.e. "value4" in this case. In case we use awk, I want to use the value in shell... (1 Reply)
Discussion started by: gaurav_1711
1 Replies

5. Shell Programming and Scripting

extract string portion using sed

Hi All I have 3 files as listed below and highlighted in bold the portions of the filenames I need to extract: TOS_TABIN218_20090323.200903231830 TOS_TABIN219_1_20090323.200903231830 TOS_TABIN219_2_20090323.200903231830 I tried source_tabin_name=`echo $fname | sed 's/_.*//'` but I... (6 Replies)
Discussion started by: santam
6 Replies

6. Shell Programming and Scripting

extract string portion from filename using sed

Hi All, I posted something similar before but I now have a another problem. I have filenames as below TOP_TABIN240_20090323.200903231830 TOP_TABIN235_1_20090323.200903231830 i need to extract the dates as in bold. Using bash v 3.xx Im trying to using the print sed command but... (11 Replies)
Discussion started by: santam
11 Replies

7. Shell Programming and Scripting

How to extract a text portion from a file

Can some one help me with shell script to extract a text block between two known strings. The given input file is as below: Name: abs Some tesxt.... Some tesxt.... Some tesxt.... end of text Name: xyz Some tesxt.... Some tesxt.... Some tesxt.... end of text Name: efg Some... (5 Replies)
Discussion started by: ejazs0
5 Replies

8. Shell Programming and Scripting

Extract a string from a line

Hiee all Can anyone tell me how to extract a string from a given line. STAPISDK_RELEASE_32_BL012_2011_JAN_25.1597 I want to extract BL012 from above. as 102 keeps on changing i want smthing like that it extract BL and 102 extrct by its own. Thankx guyzz (9 Replies)
Discussion started by: abhijtr
9 Replies

9. Shell Programming and Scripting

How to extract portion of a string?

Hi Gurus, Would like to seek some help on how to extract a portion of string from log's output as shown below. Sample of raw data: piece handle=/test123/disk_dump/test123/df0_cntrl_PCPFCI20120404_68498 tag=TAG20120404T180035 comment=NONE piece... (13 Replies)
Discussion started by: superHonda123
13 Replies

10. Shell Programming and Scripting

Extract portion of data

Hi Gurus, I need some help in extracting some of these information and massage it into the desired output as shown below. I need to extract the last row with the header in below sample which is usually the most recent date, for example: 2012-06-01 142356 mb 519 -219406 mb 1 ... (9 Replies)
Discussion started by: superHonda123
9 Replies
file-roller(1)						      General Commands Manual						    file-roller(1)

NAME
file-roller - archive manager for GNOME SYNOPSIS
file-roller [OPTIONS...] [FILE...] DESCRIPTION
File Roller is a graphical interface to archiving utilities such as tar and zip. It supports most common operations such as creating, modifing and extracting files from an archive. You can also view the contents of an archive and open files contained in the archive. OPTIONS
-a, --add-to=ARCHIVE Add files to the specified archive and quit the program -d, --add FILE Add files asking the name of the archive and quit the program -e, --extract-to=FOLDER Extract archives to the specified folder and quit the program -f, --extract Extract archives asking the destination folder and quit the program -h, --extract-here Extract archives using the archive name as destination folder and quit the program --default-dir=FOLDER Default folder to use for the '--add' and '--extract' commands --force Create destination folder without asking confirmation This program also accepts the standard GNOME and GTK options. AUTHORS
file-roller is written by Paolo Bacchilega <paolo.bacch@tin.it>. This manual page was written by Sven Arvidsson <sa@whiz.se>, for the Debian project (but may be used by others). SEE ALSO
gtk-options(7), gnome-options(7) The online documentation available through the program's Help menu. GNOME
2007-09-27 file-roller(1)
All times are GMT -4. The time now is 10:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy