Sponsored Content
Top Forums Shell Programming and Scripting Grepping for filenames containing value in specific segment within file Post 302083691 by HLee1981 on Monday 7th of August 2006 05:54:59 PM
Old 08-07-2006
Question Grepping for filenames containing value in specific segment within file

I am trying to grep for filenames containing a specific value within a particular segment. The lines containing the segment I'm looking through reads like "HL^1^^1^1", "10^9^9^0", and "HL^11^4^8^1". I would like to find the data that contains only the number nine after the third caret where the line begins with the phrase "HL". I've tried ranges with
Code:
grep -l ^HL\^[range]\^[range]\^9

, etc. but not every filename that should be returned are being reported. The values following the first and caret do not have a fixed range, nor is there a set number of how many characters will be contained there. Please help. Thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grepping a part of filenames

Hi , I have a list of files in a directory and filename format is as follows: PQ223390 PQ876912 PQ768901 PQ398140 and so on I want to grep the first four digits of all the files after PQ, into a file. Ex: 2233 8769 6890 3981 and so on Can anyone tell me the command? thankx jazz (11 Replies)
Discussion started by: jazz
11 Replies

2. Programming

a large file causes segment, how to overcome?

When printing a large file, segment occured. but part of it can be printed normally. There seems no mistake in usage. How to solve the problem. Actually, the file is not very very large. Only 300-400 A4 pages. Thanks (1 Reply)
Discussion started by: cdbug
1 Replies

3. Shell Programming and Scripting

Finiding filenames with specific index string

Hi All, I have a file (Names.txt) and the contents of the file is give below. $ cat Names.txt FF313207008.txt FF223207007.txt FF143207006.txt FF372150600.txt FF063407005.txt FF063307005.txt $ From these given file names I want to find the files which has the 6th index value as 2. So... (5 Replies)
Discussion started by: krish_indus
5 Replies

4. UNIX for Dummies Questions & Answers

Grepping A Specific Column

Hello, I have a log file that outputs the data below. I would like to grep and display the data where column is equal '148.' I've searched the forum, and couldn't find any answers. I've tried all the grep switches and I get the same result as the log. I'm thinking I might have to use an... (4 Replies)
Discussion started by: ravzter
4 Replies

5. UNIX for Dummies Questions & Answers

Searching for specific filenames

Hi I would like to know how to search through a directory and pull out files that has a specific pattern in the filename. For example if the filename has "bsc" in it, then that file must be moved to another directory where I will perform some operations on it. I know grep can be used, but I'm... (17 Replies)
Discussion started by: ladyAnne
17 Replies

6. Shell Programming and Scripting

Segment a big file into smaller ones

Greeting to all. I have big text file that I would like to segment into many smaller files. Each file should be maximum 10 000 lines. The file is called time.txt. after the execution of the file I would like to have. time_01.txt, time_02, txt, ...,time_n.txt Can anybody help. Br. (2 Replies)
Discussion started by: flash80
2 Replies

7. Programming

Data segment or Text segment

Hi, Whether the following piece of code is placed in the read-only memory of code (text) segment or data segment? char *a = "Hello"; I am getting two different answers while searching in google :( that's why the confusion is (7 Replies)
Discussion started by: royalibrahim
7 Replies

8. Shell Programming and Scripting

Grepping a specific row from a file

Hi I have output of a command saved in a file.. # cat /file.txt System: cu=4 ent=0.1 mode=on cu min u s w i 0 500 0.1 0.3 0.5 0.1 1 200 0.5 0.2 0.3 0.0 By using ksh, what I need to do is, I need to grep the u,s,w and i... (5 Replies)
Discussion started by: Priya Amaresh
5 Replies

9. Shell Programming and Scripting

Printing next two lines from a file after grepping a specific pattern

Hi I have a file like # vi require.txt 1,BANK,Read blocks that cycle. yellow Read blocks. 2,ACCOUNT,Finished Red Finished . 3,LOAN, pipe white pipe 4,PROFIT,Resolve. black Resolve Am using like cat require.txt | grep -w ACCOUNTThe output I get is (8 Replies)
Discussion started by: Priya Amaresh
8 Replies

10. Shell Programming and Scripting

Bash shell script not working-picking segment patterns from a file

Hi All, I have to pick particular segments from a file and I have prepared below shell script.But its not working and I am not able to find out whats the issue.could you guys pls help? Sample file: TS3*1451575*12*20151231*4*482.44 NM1*QC*1*CUTLER*BETTY DTM*472*20150808... (4 Replies)
Discussion started by: Venkata Prasad
4 Replies
rsm_get_segmentid_range(3RSM)			      Remote Shared Memory Library Functions			     rsm_get_segmentid_range(3RSM)

NAME
rsm_get_segmentid_range - get segment ID range SYNOPSIS
cc [ flag... ] file... -lrsm [ library... ] #include <rsmapi.h> int rsm_get_segmentid_range(const char *appid, rsm_memseg_id_t *baseid, uint32_t *length); DESCRIPTION
RSM segment IDs can be either specified by the application or generated by the system using the rsm_memseg_export_publish(3RSM) function. Applications that specify segment IDs require a reserved range of segment IDs that they can use. This can be achieved by using rsm_get_seg- mentid_range() and by reserving a range of segment IDs in the segment ID configuration file, /etc/rsm/rsm.segmentid. The rsm_get_segmen- tid_range() function can be used by applications to obtain the segment ID range reserved for them. The appid argument is a null-terminated string that identifies the application. The baseid argument points to the location where the starting segment ID of the reserved range is returned. The length argument points to the location where the number of reserved segment IDs is returned. The application can use any value starting at baseid and less than baseid+length. The application should use an offset within the range of reserved segment IDs to obtain a segment ID such that if the baseid or length is modified, it will still be within its reserved range. It is the responsibility of the system administrator to make sure that the segment ID ranges are properly administered (such that they are non-overlapping, the file on various nodes of the cluster have identical entries, and so forth.) Entries in the /etc/rsm/rsm.segmentid file are of the form: #keyword appid baseid length reserved SUNWfoo 0x600000 1000 The fields in the file are separated by tabs or blanks. The first string is a keyword "reserve", followed by the application identifier (a string without spaces), the baseid (the starting segment ID of the reserved range in hexadecimal), and the length (the number of segmentids reserved). Comment lines contain a "#" in the first column. The file should not contain blank or empty lines. Segment IDs reserved for the system are defined in the </usr/include/rsm/rsm_common.h> header and cannot be used by the applications. RETURN VALUES
Upon successful completion, these functions return 0. Otherwise, an error value is returned to indicate the error. ERRORS
The rsm_get_segmentid_range() function can return the following errors: RSMERR_BAD_ADDR The address passed is invalid. RSMERR_BAD_APPID The appid is not defined in configuration file. RSMERR_BAD_CONF The configuration file is not present or not readable, or the configuration file format is incorrect. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Unstable | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
rsm_memseg_export_publish(3RSM), attributes(5) SunOS 5.10 8 May 2003 rsm_get_segmentid_range(3RSM)
All times are GMT -4. The time now is 02:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy