delete only part of a line


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting delete only part of a line
# 8  
Old 03-23-2011
Code:
perl -pe 'BEGIN{$/="\;";} s/(extent|lock).*(.)/$2/sg;' inputfile

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To Delete the duplicates using Part of File Name

I am using the below script to delete duplicate files but it is not working for directories with more than 10k files "Argument is too long" is getting for ls -t. Tried to replace ls -t with find . -type f \( -iname "*.xml" \) -printf '%T@ %p\n' | sort -rg | sed -r 's/* //' | awk... (8 Replies)
Discussion started by: gold2k8
8 Replies

2. Programming

Mismatched free() / delete / delete [] line no missing

Could you tell me the possibilities of the reason to get the Mismatched free() / delete / delete . I unable to see the line no in the valgrind report. it displays the function name. with that function name, I am not able to find where exactly the issue is there.I am getting the Mismatched free()... (3 Replies)
Discussion started by: SA_Palani
3 Replies

3. Shell Programming and Scripting

Delete part of a column

I want to delete a part of the 4th column from the given file below: <Text Text_ID="10155645315851111_10155645333076543" From="460350337461111" Created="2011-03-16T17:05:37+0000" use_count="123">This is the first text</Text> <Text Text_ID="10155645315851111_10155645317023456"... (2 Replies)
Discussion started by: my_Perl
2 Replies

4. Shell Programming and Scripting

Find and delete part of field with awk or sed

I've got a file that looks like this (the whitespace between commas is intentional): 123456789,12,JOHN H DOE ,DOE/JOHN H ,,,DOE/JOHN H ,,,,,123 FAKE STREET ,SPRINGFIELD,XX, I want to strip just the first name out of the third field so it reads "JOHN,". So far I... (6 Replies)
Discussion started by: Scottie1954
6 Replies

5. Shell Programming and Scripting

Reading text file, comparing a value in a line, and placing only part of the line in a variable?

I need some help. I would like to read in a text file. Take a variable such as ROW-D-01, compare it to what's in one line in the text file such as PROD/VM/ROW-D-01 and only input PROD/VM into a variable without the /ROW-D-01. Is this possible? any help is appreciated. (2 Replies)
Discussion started by: xChristopher
2 Replies

6. Shell Programming and Scripting

[Solved] Printing a part of the last line of the specific part of a file

Hi, I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this: Name =A xxxxxx yyyyyy zzzzzz aaaaaa bbbbbb Value = 57 This is necessary because in a file there are written more lines which... (6 Replies)
Discussion started by: wenclu
6 Replies

7. Shell Programming and Scripting

Delete Last part

Hello, I am on solaris (ksh). I have a log file like this with directory structure and file name : /DIR1/DIR2/DIR3/filename /DIR1/DIR2/filename /DIR1/DIR2/DIR3/DIR4/DIR5/filename I am looking for a way to create a new file to be formated like this : DIR2/DIR3 DIR2... (9 Replies)
Discussion started by: Aswex
9 Replies

8. Shell Programming and Scripting

delete part of file from pattern1 to pattern2

Hi all! How can I delete all the text starting from <string1> to <string2> in all the .txt files of the folder "FOLDER" ? Thanks a lot! mjomba ... </s> <s> <w></w> </s> <s> ... to get: (1 Reply)
Discussion started by: mjomba
1 Replies

9. Shell Programming and Scripting

Delete part of string

This command: du -s /Applications/TextMate.app Returns an output like this: 65792 /Applications/TextMate.app I need to delete the space and the file path in the output leaving just the number. Thanks (2 Replies)
Discussion started by: pcwiz
2 Replies

10. Shell Programming and Scripting

How to delete part of a file?

Suppose i have a file which contains 10 lines.... i have to delete a line which starts with the word "BEGIN" and delete the consecutive lines till i find a start of line with the word "END" how to do this? (6 Replies)
Discussion started by: brkavi_in
6 Replies
Login or Register to Ask a Question
ost::Datetime(3)					     Library Functions Manual						  ost::Datetime(3)

NAME
ost::Datetime - The Datetime class uses a julian date representation of the current year, month, and day and a integer representation of the current time. SYNOPSIS
#include <numbers.h> Inherits ost::Date, and ost::Time. Public Member Functions Datetime (time_t tm) Datetime (tm *dt) Datetime (const char *str, size_t size=0) Datetime (int year, unsigned month, unsigned day, int hour, int minute, int second) Datetime () virtual ~Datetime () char * getDatetime (char *buffer) const time_t getDatetime (void) const bool isValid (void) const Datetime & operator= (const Datetime datetime) Datetime & operator+= (const Datetime &datetime) Datetime & operator-= (const Datetime &datetime) Datetime & operator+= (const Time &time) Datetime & operator-= (const Time &time) int operator== (const Datetime &) int operator!= (const Datetime &) int operator< (const Datetime &) int operator<= (const Datetime &) int operator> (const Datetime &) int operator>= (const Datetime &) bool operator! () const String strftime (const char *format) const Additional Inherited Members Detailed Description The Datetime class uses a julian date representation of the current year, month, and day and a integer representation of the current time. This is then manipulated in several forms and may be exported as needed. Author: Marcelo Dalmas mad@brasmap.com.br Integer based time class. Constructor &; Destructor Documentation ost::Datetime::Datetime (time_ttm) ost::Datetime::Datetime (tm *dt) ost::Datetime::Datetime (const char *str, size_tsize = 0) ost::Datetime::Datetime (intyear, unsignedmonth, unsignedday, inthour, intminute, intsecond) ost::Datetime::Datetime () virtual ost::Datetime::~Datetime () [virtual] Member Function Documentation char* ost::Datetime::getDatetime (char *buffer) const time_t ost::Datetime::getDatetime (void) const bool ost::Datetime::isValid (void) const Reimplemented from ost::Date. bool ost::Datetime::operator! () const Reimplemented from ost::Date. int ost::Datetime::operator!= (const Datetime &) Datetime& ost::Datetime::operator+= (const Datetime &datetime) Datetime& ost::Datetime::operator+= (const Time &time) Datetime& ost::Datetime::operator-= (const Datetime &datetime) Datetime& ost::Datetime::operator-= (const Time &time) int ost::Datetime::operator< (const Datetime &) int ost::Datetime::operator<= (const Datetime &) Datetime& ost::Datetime::operator= (const Datetimedatetime) int ost::Datetime::operator== (const Datetime &) int ost::Datetime::operator> (const Datetime &) int ost::Datetime::operator>= (const Datetime &) String ost::Datetime::strftime (const char *format) const Author Generated automatically by Doxygen for GNU CommonC++ from the source code. GNU CommonC++ Sat Jun 23 2012 ost::Datetime(3)