Sponsored Content
Top Forums Shell Programming and Scripting Extracting particular string in a file and storing matched string in output file Post 302402102 by sushmab82 on Tuesday 9th of March 2010 12:47:03 AM
Old 03-09-2010
Hi,
Thanks for your reply. But I am getting syntax error for first 3 lines in bash shell. I think If we do search line by line it is taking too much of time since input file is big. Is there any way to do using awk or sed command?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed, grep, awk, regex -- extracting a matched substring from a file/string

Ok, I'm stumped and can't seem to find relevant info. (I'm not even sure, I might have asked something similar before.): I'm trying to use shell scripting/UNIX commands to extract URLs from a fairly large web page, with a view to ultimately wrapping this in PHP with exec() and including the... (2 Replies)
Discussion started by: ropers
2 Replies

2. Shell Programming and Scripting

Extracting a string from one file and searching the same string in other files

Hi, Need to extract a string from one file and search the same in other files. Ex: I have file1 of hundred lines with no delimiters not even space. I have 3 more files. I should get 1 to 10 characters say substring from each line of file1 and search that string in rest of the files and get... (1 Reply)
Discussion started by: mohancrr
1 Replies

3. Shell Programming and Scripting

save every line in log file with matched string

i have been doing this script to match every line in a current log file (access_log) with strings that i list from a path (consist of 100 of user's name ex: meggae ).. and then make a directory of every string from the text file (/path/meggae/) --->if it matched.. then print every line from the... (3 Replies)
Discussion started by: meggae
3 Replies

4. UNIX for Dummies Questions & Answers

Output text from 1st paragraph in file w/ a specific string through last paragraph of file w/ string

Hi, I'm trying to output all text from the first paragraph in a file that contains a specific string through the last paragraph in that file that contains that string. Previously, I was outputting just each paragraph with that search string with: cat in_file | nawk '{RS=""; FS="\n";... (2 Replies)
Discussion started by: carpenn
2 Replies

5. UNIX for Dummies Questions & Answers

Commenting a line matched with a specific string in a file

Hi, I would like to comment a line that matched a string "sreenivas" in a file without opening it. Thanks in advance. Regards, Sreenivas (3 Replies)
Discussion started by: raosr020
3 Replies

6. Shell Programming and Scripting

Search for Pattern as output between the matched String

Hello, I have a file which has the below contents : VG_name LV_name LV_size in MB LV_option LV_mountpoint owner group y testdg rahul2lv 10 "-A y -L" /home/abc2 ... (6 Replies)
Discussion started by: rahul2662
6 Replies

7. UNIX for Beginners Questions & Answers

Search a string inside a pattern matched block of a file

How to grep for searching a string within a begin and end pattern of a file. Sent from my Redmi 3S using Tapatalk (8 Replies)
Discussion started by: Baishali
8 Replies

8. Shell Programming and Scripting

Insert a user input string after matched string in file

i am having file like this #!/bin/bash read -p 'Username: ' uservar match='<color="red" />' text='this is only a test so please be patient <color="red" />' echo "$text" | sed "s/$match/&$uservar\g" so desireble output what i want is if user type MARIA this is only a test so please... (13 Replies)
Discussion started by: tomislav91
13 Replies

9. UNIX for Beginners Questions & Answers

Finding specific string in file and storing in another file

Text in input file is like this <title> <band height="21" isSplitAllowed="true" > <staticText> <reportElement x="1" y="1" width="313" height="20" key="staticText-1"/> <box></box> <textElement> <font fontName="Arial" pdfFontName="Helvetica-Bold"... (4 Replies)
Discussion started by: aankita30
4 Replies
sizer(8)						      System Manager's Manual							  sizer(8)

NAME
sizer - Displays information about the system or kernel, or creates a system configuration file SYNOPSIS
/usr/sbin/sizer [-atm] [-b] [-c] [-gr] [-gt] [-implver] [-l] [-m] [-M] [-nfilename] [-p] [-pr] [-P] [-r] [-v] [-wc] [-wk] [-wp] [-wt] [-wu] OPTIONS
Indicates whether an ATM (Asynchronous Transfer Mode) adapter is present. Displays the name of the file from which the running kernel was booted. Displays the CPU type of the running CPU. Displays an ASCII string (terminated by a line feed) that specifies the size, in pix- els, for each graphics screen that exists in the system. The information is displayed in the following format: width x height. For exam- ple, 1280x1024 specifies the default graphics screen on a DEC 3000 Model 500 system. The resolutions of all the existing screens are dis- played on a single line in the same order as the ROM ID strings that are displayed by the -gt option. If no screens exist in the system, then 0x0 is displayed. Displays an ASCII ROM ID string (terminated by a line feed) for each graphics screen that exists in the system. The ROM ID string identifies the graphics controller for the screen. Some controllers can manage more than one physical or logical screen. If there are no screens in the system, then nothing is returned. Displays the family name to which the processor belongs. This can be EV4, EV5 or EV6. Displays the option for the small-memory system, or zero. Displays the running kernel's module list, if that kernel was linked at boot time. The information displayed is a space-separated list detailing the exact linker options and module names used to boot- strap link the running kernel. If the running kernel is a statically linked image, sizer displays an empty string. Displays the names of foreign kits that were linked into the running kernel at boot time, including the name of the device from which they were loaded. The device name is the one known to the console. (For example, on a DEC 3000 system, the device name for a CD-ROM device is dka400). If the running kernel is a statically linked image, sizer displays an empty string. Creates a configuration file. The -n option creates a con- figuration file in /tmp/filename and a shell script named /tmp/filename.devs that runs MAKEDEV to create devices such as Lcam. The system should be running the /genvmunix generic kernel to ensure that all required devices and options are available. Note that disk and tape device special files are created using dsfmgr(8). Note You should run doconfig to build a new kernel. Displays the number of available CPUs. Displays the number of CPUs that are cur- rently running on the system. Provides information on logical partitions. Displays the name of the root device. Displays the operating system version string. Displays the type of workstation console. This number indicates whether a graphics head was cho- sen as the system console at boot time, or whether the alternate (serial interface) console was chosen. If a graphics console was chosen, a zero (0) is returned to standard output. If an alternate console was chosen, a one (1) is returned to standard output. Displays an ASCII string that identifies the workstation keyboard if one exists in the system. For example, LK401 specifies the default keyboard on the DEC 3000 Model 500 system. Displays an ASCII string that identifies the workstation pointer if one exists in the system. For example, VSXXXAA specifies the mouse on a DEC 3000 Model 500 system. Displays the type of workstation display. This number specifies each byte, which indicates a type of display, with one byte used for each display. The limit is zero to four displays. Displays the workstation display units. This number specifies the "on" bits, which indicate the display units that exist on the system. For example, the return number 1 indicates that one display exists, the return number 3 indicates that two displays exist, the return number 7 indicates that three displays exist, and the return number 15 indicates that 4 displays exist. The limit is zero to four displays. DESCRIPTION
The sizer program reports information about the running system, including the name of the kernel file. This program is also used by the doconfig program to create a system configuration file. Note that if you use sizer with the -n option to create a configuration file, it may differ from the current configuration on your system. For example, customizations may not appear in the output from sizer. SEE ALSO
Commands: config(8), doconfig(8) System Administration sizer(8)
All times are GMT -4. The time now is 06:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy