Sponsored Content
Top Forums Programming String Manipulation in a text file Post 302764097 by John Trevor on Thursday 31st of January 2013 02:15:27 AM
Old 01-31-2013
Thanks.. I'll try the awk code

---------- Post updated at 02:15 AM ---------- Previous update was at 02:05 AM ----------

Yes, Ticket ID, Date/Time and Ticket Status are the only 3 fields that matters but I'm not sure how to do this prefixing in sed. Can you give me a sample code snippet to start with ?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Text file manipulation

Hi, I need to remove lines from a text file that are less than certain length in UNIX. For example, test.txt file contains the following lines: abcdefghijklmnopqrstuvwxyz. 123456789009876543211234567 This line to be removed. zyxwvutsrqponmlkjihgfedcba. The length of each line is supposed... (5 Replies)
Discussion started by: svannala
5 Replies

2. UNIX for Dummies Questions & Answers

Text file manipulation

I am a new unix user & I wanted to work with unix as it is very good in text manipulations. I need a little help. I will be grateful if someone can help me out. I need help in grepping a pattern of numbers from one file to another file. Specific details are as follows: File one contains only... (4 Replies)
Discussion started by: Ezy
4 Replies

3. Shell Programming and Scripting

String manipulation in a file

I have a text file having number of different rows like this.. Action & Adventure|Whiteout| Kids Free|PBS KIDS Sprout|En espanol| Kids Free|PBS KIDS Sprout|En espanol|XYZ| Basically,i want to read the file and write to another file in a tree structure like this.. each row should have 6... (7 Replies)
Discussion started by: ramse8pc
7 Replies

4. Shell Programming and Scripting

File text manipulation

What I am trying to do is make a script that will add a port number within a section of a file if it already doesn't exist in that section of the file. The particular line that I would like to add the port number to in the file is formatted like this: TCPPORTS="25 80 125 443 8080 10000" For... (3 Replies)
Discussion started by: nullifx
3 Replies

5. Shell Programming and Scripting

Text File Manipulation

Hi, I need to write shell script for the scenario explained below - datafile.txt AcctNum,code,Region,,,, 12345451,AN ,abaab 12345452,AN ,xccxc 76677545,RP ,acxcc 43567878,RP ,afghh 32190900,AN ,afrfrf 87312345,AN ,aqaw I have a text file (datafile.txt)... (1 Reply)
Discussion started by: ravigupta2u
1 Replies

6. UNIX for Dummies Questions & Answers

Text File Manipulation Help

Hi I've two text files FILE_1 and FILE_2 as shown below: FILE_1.txt CO Contig1 342 12 11 U GGGCTGACGTGGCCGCTAATACGACTCACTATAGGG*AGAGAAGTCATTTTCTTGTTTAG BQ 35 35 35 50 50 50 50 50 50 50 50 60 65 65 65 65 65 65 65 65 65 65 65 65 50 AF GP5UOVN01AOPE0 U 1 AF GP5UOVN01AT8W3 U 1 ... (1 Reply)
Discussion started by: Fahmida
1 Replies

7. Shell Programming and Scripting

Awk to convert a text file to CSV file with some string manipulation

Hi , I have a simple text file with contents as below: 12345678900 971,76 4234560890 22345678900 5971,72 5234560990 32345678900 71,12 6234560190 the new csv-file should be like: Column1;Column2;Column3;Column4;Column5 123456;78900;971,76;423456;0890... (9 Replies)
Discussion started by: FreddyDaKing
9 Replies

8. UNIX for Dummies Questions & Answers

Mathematical manipulation of a text file

I have a tab delimited file with 4 columns. If the value in the first column, equals the value in the second column, I'd like to have the 4th column multiplied by 2 then add 1. If the value in the first column differs from the value in the second, I'd like to have the 4th column multiplied by 2... (5 Replies)
Discussion started by: evelibertine
5 Replies

9. Shell Programming and Scripting

Text file manipulation

Hi Gurus, I have a question I have a flat file like below with three fields (3 rd field is amt) ad|B|500 cc||100 dd|C|600 ee||900 Need to write a code in such a way that when second field is empty then do sum of third field So in this case it will be 100 +900 I tried but no luck... (1 Reply)
Discussion started by: patricjemmy6
1 Replies

10. UNIX for Dummies Questions & Answers

Text File Manipulation

Hello, Supposing I had a huge list as follows: TAC manufacturer Device Type 1392600 LG D959 LG-D959TS FeaturePhone 1409700 LG V410 FeaturePhone 35150806 LG F350S FeaturePhone 35165206 Samsung GT-E1200 FeaturePhone 35194505 Nokia Asha 200 FeaturePhone but I want to make it look like... (3 Replies)
Discussion started by: Cludgie
3 Replies
RT::Client::REST::Ticket(3pm)				User Contributed Perl Documentation			     RT::Client::REST::Ticket(3pm)

NAME
RT::Client::REST::Ticket -- this object represents a ticket. SYNOPSIS
my $rt = RT::Client::REST->new(server => $ENV{RTSERVER}); # Create a new ticket: my $ticket = RT::Client::REST::Ticket->new( rt => $rt, queue => "General", subject => $subject, )->store(text => "This is the initial text of the ticket"); print "Created a new ticket, ID ", $ticket->id, " "; # Update my $ticket = RT::Client::REST::Ticket->new( rt => $rt, id => $id, priority => 10, )->store; # Retrieve my $ticket => RT::Client::REST::Ticket->new( rt => $rt, id => $id, )->retrieve; unless ($ticket->owner eq $me) { $ticket->steal; # Give me more work! } DESCRIPTION
RT::Client::REST::Ticket is based on RT::Client::REST::Object. The representation allows one to retrieve, edit, comment on, and create tickets in RT. ATTRIBUTES
id This is the numeric ID of the ticket. queue This is the name of the queue (not numeric id). owner Username of the owner. creator Username of RT user who created the ticket. subject Subject of the ticket. status The status is usually one of the following: "new", "open", "resolved", "stalled", "rejected", and "deleted". However, custom RT installations sometimes add their own statuses. priority Ticket priority. Usually a numeric value. initial_priority final_priority requestor This is the attribute for setting the requestor on ticket creation. If you use requestors to do this in 3.8, the recipient may not receive an autoreply from RT because the ticket is initially created as the user your REST session is connected as. It is a list attribute (for explanation of list attributes, see LIST ATTRIBUTE PROPERTIES in RT::Client::REST::Object). requestors This contains e-mail addresses of the requestors. It is a list attribute (for explanation of list attributes, see LIST ATTRIBUTE PROPERTIES in RT::Client::REST::Object). cc A list of e-mail addresses used to notify people of 'correspond' actions. admin_cc A list of e-mail addresses used to notify people of all actions performed on a ticket. created Time at which ticket was created. Note that this is an immutable field and therefore the value cannot be changed.. starts started due resolved told time_estimated time_worked time_left last_updated DB METHODS
For full explanation of these, please see "DB METHODS" in RT::Client::REST::Object documentation. retrieve Retrieve RT ticket from database. store ([text => $text]) Create or update the ticket. When creating a new ticket, optional 'text' parameter can be supplied to set the initial text of the ticket. search Search for tickets that meet specific conditions. TICKET-SPECIFIC METHODS comment (message => $message, %opts) Comment on this ticket with message $message. %opts is a list of key-value pairs as follows: attachments List of filenames (an array reference) that should be attached to the ticket along with the comment. cc List of e-mail addresses to send carbon copies to (an array reference). bcc List of e-mail addresses to send blind carbon copies to (an array reference). correspond (message => $message, %opts) Add correspondence to the ticket. Takes exactly the same arguments as the comment method above. attachments Get attachments associated with this ticket. What is returned is an object of type RT::Client::REST::SearchResult which can then be used to get at objects of type RT::Client::REST::Attachment. transactions Get transactions associated with this ticket. Optionally, you can specify exactly what types of transactions you want listed, for example: my $result = $ticket->transactions(type => [qw(Comment Correspond)]); Please reference RT::Client::REST documentation for the full list of valid transaction types. Return value is an object of type RT::Client::REST::SearchResult which can then be used to iterate over transaction objects (RT::Client::REST::Transaction). take Take this ticket. If you already the owner of this ticket, "RT::Client::REST::Object::NoopOperationException" will be thrown. untake Untake this ticket. If Nobody is already the owner of this ticket, "RT::Client::REST::Object::NoopOperationException" will be thrown. steal Steal this ticket. If you already the owner of this ticket, "RT::Client::REST::Object::NoopOperationException" will be thrown. CUSTOM FIELDS
This class inherits 'cf' method from RT::Client::REST::Object. To create a ticket with a bunch of custom fields, use the following approach: RT::Client::REST::Ticket->new( rt => $rt, # blah blah cf => { 'field one' => $value1, 'field two' => $another_value, }, )->store; Some more examples: # Update a custom field value: $ticket->cf('field one' => $value1); $ticket->store; # Get a custom field value: my $another value = $ticket->cf('field two'); # Get a list of ticket's custom field names: my @custom_fields = $ticket->cf; INTERNAL METHODS
rt_type Returns 'ticket'. SEE ALSO
RT::Client::REST, RT::Client::REST::Object, RT::Client::REST::Attachment, RT::Client::REST::SearchResult, RT::Client::REST::Transaction. AUTHOR
Dmitri Tikhonov <dtikhonov@yahoo.com> LICENSE
Perl license with the exception of RT::Client::REST, which is GPLed. perl v5.14.2 2012-01-20 RT::Client::REST::Ticket(3pm)
All times are GMT -4. The time now is 01:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy