Sponsored Content
Top Forums Shell Programming and Scripting extract whole thing in word, leaving behind last word. - perl Post 302532766 by asak on Wednesday 22nd of June 2011 04:32:00 AM
Old 06-22-2011
Question extract whole thing in word, leaving behind last word. - perl

Hi,

i've a string
/u/user/DTE/T_LOGS/20110622_011532_TEST_11_HD_120/HD/TESi T_11_HD_120/hd-12

i need to get string, like

/u/user/DTE/T_LOGS/20110622_011532_TEST_11_HD_120/HD

the words from HD should get deleted, i need only a string till HD, i dont want to use any built in fuctions, pure reg-x code i need.

like :
/u/user/DTE/T_LOGS/20110622_011532_TEST_11_HD_120/HD


Please help,
Thanks,
asak
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can a shell script pull the first word (or nth word) off each line of a text file?

Greetings. I am struggling with a shell script to make my life simpler, with a number of practical ways in which it could be used. I want to take a standard text file, and pull the 'n'th word from each line such as the first word from a text file. I'm struggling to see how each line can be... (5 Replies)
Discussion started by: tricky
5 Replies

2. Shell Programming and Scripting

perl newbie: how to extract an unknown word from a string

hi, im quite new to perl regexp. i have a problem where i want to extract a word from a given string. but the word is unknown, only fact is that it appears as the second word in the string. Eg. input string(s) : char var1 = 'A'; int var2 = 10; char *ptr; and what i want to do is... (3 Replies)
Discussion started by: wolwy_pete
3 Replies

3. Shell Programming and Scripting

perl (word by word check if a hash key)

Hi, Now i work in a code that 1-get data stored in the database in the form of hash table with a key field which is the " Name" 2-in the same time i open a txt file and loop through it word by word 3- which i have a problem in is that : I need to loop word by word and check if it is a... (0 Replies)
Discussion started by: eng_shimaa
0 Replies

4. Shell Programming and Scripting

To read data word by word from given file & storing in variables

File having data in following format : file name : file.txt -------------------- 111111;name1 222222;name2 333333;name3 I want to read this file so that I can split these into two paramaters i.e. 111111 & name1 into two different variables(say value1 & value2). i.e val1=11111 &... (2 Replies)
Discussion started by: sjoshi98
2 Replies

5. Programming

extract xml data and create word document using perl.

hi, i have large xml file which contains students information, i need to extract student number and some address tags and create a word document for the extracted data. my data looking llike this <student> <number>24</number> <education>bachelors</education> ... (1 Reply)
Discussion started by: veerubiji
1 Replies

6. Programming

Extract xml data and create word document using perl.

Hi, I have large xml data file.I need to extract node and some tags in the node and after I need to create word document. my XMl data is look like as below -<student> <number>24</number> <education>bachelor</bachelor> <specialization>computers</specialization> ... (3 Replies)
Discussion started by: veerubiji
3 Replies

7. UNIX for Dummies Questions & Answers

Find EXACT word in files, just the word: no prefix, no suffix, no 'similar', just the word

I have a file that has the words I want to find in other files (but lets say I just want to find my words in a single file). Those words are IDs, so if my word is ZZZ4, outputs like aaZZZ4, ZZZ4bb, aaZZZ4bb, ZZ4, ZZZ, ZyZ4, ZZZ4.8 (or anything like that) WON'T BE USEFUL. I need the whole word... (6 Replies)
Discussion started by: chicchan
6 Replies

8. Shell Programming and Scripting

perl lwp find word and print next word :)

hi all, I'm new there, I'm just playing with perl and lwp and I just successfully created a script for log in to a web site with post. I have a response but I would like to have something like this: I have in my response lines like: <div class="sender">mimi020</div> <some html code.....>... (3 Replies)
Discussion started by: vogueestylee
3 Replies

9. Shell Programming and Scripting

Perl script to extract a word from the file

Hi everyone, I'm a perl newbie and need your help to extract a word inside the list of files with same pattern. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:mycode xmlns:ns2="http://www.abcd.com/pqrs/acfSchema-2007a.xsd"> <id>10</id> <name>PaymentServices</name> ... (7 Replies)
Discussion started by: jhamaks
7 Replies

10. UNIX for Beginners Questions & Answers

How to search for a word in column header that fully matches the word not partially in awk?

I have a multicolumn text file with header in the first row like this The headers are stored in an array called . which contains I want to search for each elements of this array from that multicolumn text file. And I am using this awk approach for ii in ${hdr} do gawk -vcol="$ii" -F... (1 Reply)
Discussion started by: Atta
1 Replies
X25(7)							     Linux Programmer's Manual							    X25(7)

NAME
x25 - ITU-T X.25 / ISO-8208 protocol interface. SYNOPSIS
#include <sys/socket.h> #include <linux/x25.h> x25_socket = socket(AF_X25, SOCK_SEQPACKET, 0); DESCRIPTION
X25 sockets provide an interface to the X.25 packet layer protocol. This allows applications to communicate over a public X.25 data net- work as standardized by International Telecommunication Union's recommendation X.25 (X.25 DTE-DCE mode). X25 sockets can also be used for communication without an intermediate X.25 network (X.25 DTE-DTE mode) as described in ISO-8208. Message boundaries are preserved -- a read(2) from a socket will retrieve the same chunk of data as output with the corresponding write(2) to the peer socket. When necessary, the kernel takes care of segmenting and reassembling long messages by means of the X.25 M-bit. There is no hard-coded upper limit for the message size. However, reassembling of a long message might fail if there is a temporary lack of sys- tem resources or when other constraints (such as socket memory or buffer size limits) become effective. If that occurs, the X.25 connec- tion will be reset. Socket addresses The AF_X25 socket address family uses the struct sockaddr_x25 for representing network addresses as defined in ITU-T recommendation X.121. struct sockaddr_x25 { sa_family_t sx25_family; /* must be AF_X25 */ x25_address sx25_addr; /* X.121 Address */ }; sx25_addr contains a char array x25_addr[] to be interpreted as a null-terminated string. sx25_addr.x25_addr[] consists of up to 15 (not counting the terminating null byte) ASCII characters forming the X.121 address. Only the decimal digit characters from '0' to '9' are allowed. Socket options The following X.25-specific socket options can be set by using setsockopt(2) and read with getsockopt(2) with the level argument set to SOL_X25. X25_QBITINCL Controls whether the X.25 Q-bit (Qualified Data Bit) is accessible by the user. It expects an integer argument. If set to 0 (default), the Q-bit is never set for outgoing packets and the Q-bit of incoming packets is ignored. If set to 1, an additional first byte is prepended to each message read from or written to the socket. For data read from the socket, a 0 first byte indicates that the Q-bits of the corresponding incoming data packets were not set. A first byte with value 1 indicates that the Q-bit of the corresponding incoming data packets was set. If the first byte of the data written to the socket is 1, the Q-bit of the correspond- ing outgoing data packets will be set. If the first byte is 0, the Q-bit will not be set. VERSIONS
The AF_X25 protocol family is a new feature of Linux 2.2. BUGS
Plenty, as the X.25 PLP implementation is CONFIG_EXPERIMENTAL. This man page is incomplete. There is no dedicated application programmer's header file yet; you need to include the kernel header file <linux/x25.h>. CONFIG_EXPERI- MENTAL might also imply that future versions of the interface are not binary compatible. X.25 N-Reset events are not propagated to the user process yet. Thus, if a reset occurred, data might be lost without notice. SEE ALSO
socket(2), socket(7) Jonathan Simon Naylor: "The Re-Analysis and Re-Implementation of X.25." The URL is <ftp://ftp.pspt.fi/pub/ham/linux/ax25/x25doc.tgz>. COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2017-09-15 X25(7)
All times are GMT -4. The time now is 05:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy