Sponsored Content
Top Forums Shell Programming and Scripting Grab characters following grep Post 302437018 by anbu23 on Tuesday 13th of July 2010 04:50:00 PM
Old 07-13-2010
Code:
$ echo "MODStandard , Building=3A 1234, Syntax ID=3B=" | sed "s/.*Building[^,]*\([^, ]\{4\}\),.*/Building=\1/"
Building=1234

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Grep and extract the characters after

Hi All, I have lines like below in a file A /u/ab/test1.dat A/u/ab/test2.dat A /u/bb/test3.dat A/u/cc/test4.dat I will need /u/ab/test1.dat /u/ab/test2.dat /u/bb/test3.dat /u/cc/test4.dat Pls help Thanks (6 Replies)
Discussion started by: thumsup9
6 Replies

2. UNIX Desktop Questions & Answers

grep with special characters

Hi there I need to grep for a detail from a file. The pattern to search for involves escape sequences in it. This causes for the problem. grep "P\_SOME\_STRING\_SEARCH" filename Note, I have line like below in the file and expect it to grep. select * from my_system_param ... (3 Replies)
Discussion started by: guruparan18
3 Replies

3. UNIX for Dummies Questions & Answers

Using grep to find one or more characters

Hi I am a little stuck using grep. I want to be able to find from a file all lines which have the sequence of characters t, followed by any character, followed by the characters ing. I have tried looking at the man pages for help, but did not understand it correctly (as it is not the most... (9 Replies)
Discussion started by: rushhour
9 Replies

4. UNIX for Dummies Questions & Answers

Grab Portion of Output Text (sed, grep, awk?)

Alright, here's the deal. I'm running the following ruby script (output follows): >> /Users/name/bin/acweather.rb -z 54321 -o /Users/name/bin -c Clouds AND Sun 57/33 - Mostly sunny and cool I want to just grab the "57/33" portion, but that's it. I don't want any other portion of the line. I... (5 Replies)
Discussion started by: compulsiveguile
5 Replies

5. UNIX for Dummies Questions & Answers

Is it possible to grep a certain amount of characters?

I have a file similar to the following filler filler filler car 6 mazda filler filler filler filler car civic honda car rav 4 toyota filler filler If i do a "grep -i car file.txt" the output would be car 6 mazda car civic honda car rav 4 toyota however, i want to have the... (4 Replies)
Discussion started by: jl487
4 Replies

6. Shell Programming and Scripting

Grep with special Characters

Need Help For GREP I have a file say g1.txt and content of file is below REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoDrives /t REG_DWORD /d 4 /f , REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoClose /t REG_DWORD /d 1 /f ,... (4 Replies)
Discussion started by: jalpasoni
4 Replies

7. Shell Programming and Scripting

grep grab 19 letters from now or a full line

Hi, I have a file like this >hg19_chr1_123_456_+ asndbansbdahsjdbfsjhfghjdsghjdghjdjhdghjjdkhfsdkjfhdsjkdkjghkjdhgfjkhjfkf hasjgdhjsgfhjdsgfdsgfjhdgjhdjhdhjdfhjdfjgfdfbdghjbfjksdhfjsfdghjgdhjgfdjhgd jhgdfj >hg19_chr1_123_456_-... (5 Replies)
Discussion started by: jacobs.smith
5 Replies

8. Shell Programming and Scripting

grep particular characters help

Hello folks i have file which is below, i want to extract last column of file that contains dm-21 or dm-13 or dm-N it show output like I have tried but i got this (16 Replies)
Discussion started by: learnbash
16 Replies

9. Shell Programming and Scripting

Grep with ... matching more than 3 characters

I am trying to understand what the grep command in ubuntu is trying to do here. The contents of my test file is given below harsha@harsha-H67MA-USB3-B3:~/Documents$ cat data abcd efghi jklmno pqr stuv wxyz When I grep for 3 dots (...) without the parenthesis as follows I would expect the... (4 Replies)
Discussion started by: sreeharshasn
4 Replies

10. UNIX for Beginners Questions & Answers

How do I use grep to grab prime number output from my factor program?

I have a factor program that runs and outputs to stdout all the prime numbers that are specified in the given paramters, in this case 30000000-31000000. Command: factor/factor 30000000-31000000 Sample output: 30999979 = 30999979 30999980 = 2^2 5 11 140909 30999981 = 3 10333327... (6 Replies)
Discussion started by: steezuschrist96
6 Replies
Building Custom Topologies(3)				     Hardware Locality (hwloc)				     Building Custom Topologies(3)

NAME
Building Custom Topologies - Functions int hwloc_custom_insert_topology (hwloc_topology_t newtopology, hwloc_obj_t newparent, hwloc_topology_t oldtopology, hwloc_obj_t oldroot) hwloc_obj_t hwloc_custom_insert_group_object_by_parent (hwloc_topology_t topology, hwloc_obj_t parent, int groupdepth) Detailed Description A custom topology may be initialized by calling hwloc_topology_set_custom() after hwloc_topology_init(). It may then be modified by inserting objects or entire topologies. Once done assembling, hwloc_topology_load() should be invoked as usual to finalize the topology. Function Documentation hwloc_obj_t hwloc_custom_insert_group_object_by_parent (hwloc_topology_ttopology, hwloc_obj_tparent, intgroupdepth) Insert a new group object inside a custom topology. An object with type HWLOC_OBJ_GROUP is inserted as a new child of object parent. groupdepth is the depth attribute to be given to the new object. It may for instance be 0 for top-level groups, 1 for their children, and so on. The custom topology newtopology must have been prepared with hwloc_topology_set_custom() and not loaded with hwloc_topology_load() yet. parent may be either the root of topology or an object that was added earlier through hwloc_custom_insert_group_object_by_parent(). int hwloc_custom_insert_topology (hwloc_topology_tnewtopology, hwloc_obj_tnewparent, hwloc_topology_toldtopology, hwloc_obj_toldroot) Insert an existing topology inside a custom topology. Duplicate the existing topology oldtopology inside a new custom topology newtopology as a leaf of object newparent. If oldroot is not NULL, duplicate oldroot and all its children instead of the entire oldtopology. Passing the root object of oldtopology in oldroot is equivalent to passing NULL. The custom topology newtopology must have been prepared with hwloc_topology_set_custom() and not loaded with hwloc_topology_load() yet. newparent may be either the root of newtopology or an object that was added through hwloc_custom_insert_group_object_by_parent(). Author Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code. Version 1.4.1 Mon Feb 27 2012 Building Custom Topologies(3)
All times are GMT -4. The time now is 12:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy