Sponsored Content
Top Forums Shell Programming and Scripting Extracting Details from string -- Help Me!!! Post 302910380 by panyam on Thursday 24th of July 2014 03:48:26 AM
Old 07-24-2014
Code:
 echo $FilePath | cut -d"/" -f1

 echo "$FilePath" | sed   's/$HOST_NAME_LAND//'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting String from a list

I have a string of Data such as Date Time Tran1 Tran2 Tran3 ...... How can I extract just all the trans excluding Date and Time. Thanks, Odogbolu98 ;) (4 Replies)
Discussion started by: odogbolu98
4 Replies

2. Shell Programming and Scripting

extracting from a string

How do I extract 5th to 10th characters of string as given below stored in a shell variable. "ab cd ef gh ij kl" How is cut to be used on this? Thanks for any help. (1 Reply)
Discussion started by: preetikate
1 Replies

3. 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

4. Shell Programming and Scripting

extracting a string

Hi All, I am writing a shell script for which I am stuck with an extraction part. I arrived till extraction of a path of file. Lets take an example. I now have a file which contains following one line: 2348/home/userid/mydir/any_num_dir/myfile.text Now I want to extract only... (2 Replies)
Discussion started by: start_shell
2 Replies

5. Shell Programming and Scripting

Extracting String

I am trying to extract a hyperlink from a html document using awk. I have managed to output in the format... href="index.html"> where i would like it just to output index.html. Any ideas on how i would do this? Thanks (2 Replies)
Discussion started by: adpe
2 Replies

6. Shell Programming and Scripting

Extracting Date from string

Hi Gurus I want to extract a date and version code which shall come in filename consisting of underscores. The filename can contain any / one underscores but the version number will come after date and will be separted by underscore String formats ============= ABC_20090815_2.csv... (13 Replies)
Discussion started by: r_t_1601
13 Replies

7. Shell Programming and Scripting

Extracting particular string in a file and storing matched string in output file

Hi , I have input file and i want to extract below strings <msisdn xmlns="">0492001956</ msisdn> => numaber inside brackets <resCode>3000</resCode> => 3000 needs to be extracted <resMessage>Request time getBalances_PSM.c(37): d out</resMessage></ns2:getBalancesResponse> => the word... (14 Replies)
Discussion started by: sushmab82
14 Replies

8. UNIX for Dummies Questions & Answers

Extracting numbers from a String

Hi all, I'm a new programmer to shell script... and I have no idea how to use substring. I want to extract the numbers from the following string and place it into a variable: "170 unique conformations found" The numbers can be more than three digits depending on the case. I just want to... (10 Replies)
Discussion started by: ah7391
10 Replies

9. UNIX for Dummies Questions & Answers

at -l doesnt give details of the scheduled job. How to get the details?

I have scheduled couple of shell scripts to run using 'at' command. The o/p of at -l is: $ at -l 1320904800.a Thu Nov 10 01:00:00 2011 1320894000.a Wed Nov 9 22:00:00 2011 1320876000.a Wed Nov 9 17:00:00 2011 $ uname -a SunOS dc2prcrptetl2 5.9 Generic_122300-54 sun4u sparc... (2 Replies)
Discussion started by: superparticle
2 Replies

10. Shell Programming and Scripting

Extracting substring within string between 2 token within the string

Hello. First best wishes for everybody. here is the input file ("$INPUT1") contents : BASH_FUNC_message_begin_script%%=() { local -a L_ARRAY; BASH_FUNC_message_debug%%=() { local -a L_ARRAY; BASH_FUNC_message_end_script%%=() { local -a L_ARRAY; BASH_FUNC_message_error%%=() { local... (3 Replies)
Discussion started by: jcdole
3 Replies
zipios::BasicEntry(3)					     Library Functions Manual					     zipios::BasicEntry(3)

NAME
zipios::BasicEntry - BasicEntry is a FileEntry that is suitable as a base class for basic entries, that e.g. SYNOPSIS
#include <basicentry.h> Inherits zipios::FileEntry. Public Member Functions BasicEntry (const string &filename, const string &comment, const FilePath &basepath=FilePath()) Constructor. virtual string getComment () const Returns the comment of the entry, if it has one. virtual uint32 getCompressedSize () const Returns the compressed size of the entry. virtual uint32 getCrc () const Returns the Crc for the entry, if it has one. virtual vector< unsigned char > getExtra () const Returns a vector of bytes of extra data that may be stored with the entry. virtual StorageMethod getMethod () const Returns the method used to store the entry in the FileCollection. virtual string getName () const Returns the full filename of the entry, including a path if the entry is stored in a subfolder. virtual string getFileName () const Returns the filename of the entry. virtual uint32 getSize () const Returns the (uncompressed) size of the entry data. virtual int getTime () const Returns the date and time of FIXME: what? virtual bool isValid () const Any method or operator that initializes a FileEntry may set a flag, that specifies whether the read entry is valid or not. virtual bool isDirectory () const Returns true if the entry is a directory. virtual void setComment (const string &comment) Sets the comment field for the FileEntry. virtual void setCompressedSize (uint32 size) Set the compressed size field of the entry. virtual void setCrc (uint32 crc) Sets the crc field. virtual void setExtra (const vector< unsigned char > &extra) Sets the extra field. virtual void setMethod (StorageMethod method) Sets the storage method field for the entry. virtual void setName (const string &name) Sets the name field for the entry. virtual void setSize (uint32 size) Sets the size field for the entry. virtual void setTime (int time) Sets the time field for the entry. virtual string toString () const Returns a human-readable string representation of the entry. virtual FileEntry * clone () const Create a heap allocated clone of the object this method is called for. Protected Attributes string _filename string _comment int _size bool _valid FilePath _basepath Detailed Description BasicEntry is a FileEntry that is suitable as a base class for basic entries, that e.g. do not support any form of compression Definition at line 18 of file basicentry.h. Constructor &; Destructor Documentation zipios::BasicEntry::BasicEntry (const string &filename, const string &comment, const FilePath &basepath = FilePath()) [explicit] Constructor. Parameters: filename the filename of the entry. comment a comment for the entry. Definition at line 24 of file basicentry.cpp. Member Function Documentation FileEntry * zipios::BasicEntry::clone () const [virtual] Create a heap allocated clone of the object this method is called for. The caller is responsible for deallocating the clone when he is done with it. Returns: A heap allocated copy of the object this method is called for. Implements zipios::FileEntry. Definition at line 132 of file basicentry.cpp. string zipios::BasicEntry::getComment () const [virtual] Returns the comment of the entry, if it has one. Otherwise it returns an empty string. Returns: the comment associated with the entry, if there is one. Implements zipios::FileEntry. Definition at line 42 of file basicentry.cpp. uint32 zipios::BasicEntry::getCompressedSize () const [virtual] Returns the compressed size of the entry. If the entry is not stored in a compressed format, the uncompressed size is returned. Returns: the compressed size of the entry. If the entry is stored without compression the uncompressed size is returned. Implements zipios::FileEntry. Definition at line 46 of file basicentry.cpp. uint32 zipios::BasicEntry::getCrc () const [virtual] Returns the Crc for the entry, if it has one. FIXME: what is returned if it doesn't have one? Returns: the Crc for the entry, if it has one. Implements zipios::FileEntry. Definition at line 50 of file basicentry.cpp. vector< unsigned char > zipios::BasicEntry::getExtra () const [virtual] Returns a vector of bytes of extra data that may be stored with the entry. Returns: A vector< unsigned char > of extra bytes that may potentially be associated with an entry. Implements zipios::FileEntry. Definition at line 54 of file basicentry.cpp. string zipios::BasicEntry::getFileName () const [virtual] Returns the filename of the entry. Returns: Returns the filename of the entry. Implements zipios::FileEntry. Definition at line 66 of file basicentry.cpp. StorageMethod zipios::BasicEntry::getMethod () const [virtual] Returns the method used to store the entry in the FileCollection. Returns: the storage method used to store the entry in the collection. See also: StorageMethod. Implements zipios::FileEntry. Definition at line 58 of file basicentry.cpp. string zipios::BasicEntry::getName () const [virtual] Returns the full filename of the entry, including a path if the entry is stored in a subfolder. Returns: the filename of the entry, including path if the entry is stored in a sub-folder. Implements zipios::FileEntry. Definition at line 62 of file basicentry.cpp. uint32 zipios::BasicEntry::getSize () const [virtual] Returns the (uncompressed) size of the entry data. Returns: Returns the (uncompressed) size of the entry. Implements zipios::FileEntry. Definition at line 79 of file basicentry.cpp. int zipios::BasicEntry::getTime () const [virtual] Returns the date and time of FIXME: what? Returns: the date and time of the entry. Implements zipios::FileEntry. Definition at line 83 of file basicentry.cpp. bool zipios::BasicEntry::isDirectory () const [virtual] Returns true if the entry is a directory. A directory entry is an entry which name ends with a separator ('/' for Unix systems, '' for Windows and DOS systems. Returns: true if the entry is a directory. Implements zipios::FileEntry. Definition at line 92 of file basicentry.cpp. bool zipios::BasicEntry::isValid () const [virtual] Any method or operator that initializes a FileEntry may set a flag, that specifies whether the read entry is valid or not. If it isn't this method returns false. Returns: true if the FileEntry has been parsed succesfully. Implements zipios::FileEntry. Definition at line 87 of file basicentry.cpp. void zipios::BasicEntry::setComment (const string &comment) [virtual] Sets the comment field for the FileEntry. Parameters: comment string with the new comment. Implements zipios::FileEntry. Definition at line 98 of file basicentry.cpp. void zipios::BasicEntry::setCompressedSize (uint32size) [virtual] Set the compressed size field of the entry. Parameters: size value to set the compressed size field of the entry to. Implements zipios::FileEntry. Definition at line 102 of file basicentry.cpp. void zipios::BasicEntry::setCrc (uint32crc) [virtual] Sets the crc field. Parameters: crc value to set the crc field to. Implements zipios::FileEntry. Definition at line 105 of file basicentry.cpp. void zipios::BasicEntry::setExtra (const vector< unsigned char > &extra) [virtual] Sets the extra field. Parameters: extra the extra field is set to this value. Implements zipios::FileEntry. Definition at line 108 of file basicentry.cpp. void zipios::BasicEntry::setMethod (StorageMethodmethod) [virtual] Sets the storage method field for the entry. Parameters: method the method field is set to the specified value. Implements zipios::FileEntry. Definition at line 111 of file basicentry.cpp. void zipios::BasicEntry::setName (const string &name) [virtual] Sets the name field for the entry. Parameters: name the name field is set to the specified value. Implements zipios::FileEntry. Definition at line 114 of file basicentry.cpp. void zipios::BasicEntry::setSize (uint32size) [virtual] Sets the size field for the entry. Parameters: size the size field is set to this value. Implements zipios::FileEntry. Definition at line 118 of file basicentry.cpp. void zipios::BasicEntry::setTime (inttime) [virtual] Sets the time field for the entry. Parameters: time the time field is set to the specified value. Implements zipios::FileEntry. Definition at line 122 of file basicentry.cpp. string zipios::BasicEntry::toString () const [virtual] Returns a human-readable string representation of the entry. Returns: a human-readable string representation of the entry. Implements zipios::FileEntry. Definition at line 126 of file basicentry.cpp. Author Generated automatically by Doxygen for Zipios++ from the source code. Zipios++ Mon Oct 10 2011 zipios::BasicEntry(3)
All times are GMT -4. The time now is 04:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy