Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Extracting information from text fields. Post 302120314 by spindoctor on Tuesday 5th of June 2007 04:56:33 PM
Old 06-05-2007
That's really helpful. For some reason, however, the gsub command doesn't delete the backslashes in the files. When I play with it, the command doesn't return an error; it seems to complete, but the files still contain the slashes.

Also, the field variables don't write exactly right. The /Author/{print "Author: "$2 }string only prints the first, not both names of the author. I had to modify it to read "$2, $3" to get first and last names. Any clue why that might be?

Thanks again though, this is what I was looking for!
Simon
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting information from a template

I have a template that I usually use to generate stats on an hourly basis for a number of cell sites altogether. I would like to be able to write a script that would go to the template and extract the information for any single site at any time during the day. For example, let's say that my... (4 Replies)
Discussion started by: Ernst
4 Replies

2. Shell Programming and Scripting

extracting fields

Hi, i have a line with several fields (indefinite number of - count varies) separated by colon. Now, i need to pick each field (except the first one) and have it assigned to variable within a loop. In other words, in the first iteration of the loop, the variable must be assigned with 2nd... (2 Replies)
Discussion started by: prvnrk
2 Replies

3. Shell Programming and Scripting

Problems with extracting information

Hi all, <select name="comp" id="comp" style="width:130px;"> <?php $sqlcomp = mysql_query("SELECT * FROM comp"); while ($redcomp = mysql_fetch_array($sqlcomp)) { extract($redcomp); echo "<option value=\"$comp_id\">comp_name</option>"; } ?> ... (0 Replies)
Discussion started by: c0mrade
0 Replies

4. Shell Programming and Scripting

Extracting information from Config files /text processing

Hello All, This is my first post on this forums, which I consider one of the best of its kind. The reason for my post is that I want to export some information form Nagios configuration files to a DB. I know that there are other tools available to do this, like NDO, monarch, etc... But I want to... (3 Replies)
Discussion started by: oconmx
3 Replies

5. Shell Programming and Scripting

extracting information from multiple files

Hello there, I am trying to extract (string) information ( a list words) from 4 files and then put the results into 1 file. Currently I am doing this using grep -f list.txt file1 . and repeat the process for the other 3 files. The reasons i am doing that (a) I do know how to code (b) each file... (4 Replies)
Discussion started by: houkto
4 Replies

6. Shell Programming and Scripting

Extracting relevant information from syslogs.

I need to analyse some syslogs and I want to print out all the lines containing SSH connections to the inside interface of the firewall and ignore lines where the originating port is 22. So basically I want to print all matches after "to inside:" that contains /22 and ignore lines where /22 occur... (2 Replies)
Discussion started by: lewk
2 Replies

7. Shell Programming and Scripting

Problems extracting some information

Hi there! Well, I'm writing a script to obtain certain information about files. Specifically, I want to get the information about those files which last access were in the last 24 hours, so I'm doing something like this: find <directory_name> -atime -1 -printf '%f %a\n' I would also... (4 Replies)
Discussion started by: Skirmish
4 Replies

8. Shell Programming and Scripting

Extracting information using awk

I want to write a script that extracts a value from a line of text. I know it can be done using awk but I've never used awk before so I don't know how to do it. The text is: Mem: 100M Active, 2150K Cache, 500M Buf, 10G Free I want to extract the free memory value to use as a variable. In... (5 Replies)
Discussion started by: millsy5
5 Replies

9. Shell Programming and Scripting

[Solved] Extracting information from DDL's

Dear Experts, I need your help here. I have lot of teradata DDL's as follows, i want to extract field names , field attributes and NOT NULL information from DDL.Could you please help here. Sample DDL: CREATE MULTISET TABLE APS_CALL_IN_PICKUP_CANCELED ,NO FALLBACK , NO BEFORE... (2 Replies)
Discussion started by: srikanth38
2 Replies

10. Shell Programming and Scripting

Extracting information from XML to excel

Hi, I am trying to extract information from a XML file and write it to a excel sheet. I am not sure where to start from. Here is the content from my input XML file. <com.cloudbees.hudson.plugins.folder.properties.FolderProxyGroupContainer plugin="nectar-rbac@4.5"> <groups> ... (4 Replies)
Discussion started by: Sajjadmehdi
4 Replies
Net::Hotline::Task(3pm) 				User Contributed Perl Documentation				   Net::Hotline::Task(3pm)

NAME
Net::Hotline::Task - Task object used internally by Net::Hotline::Client SYNOPSIS
use Net::Hotline::Task; $task = new Net::Hotline::Task; $task->start(time()); $task->num($num++); ... DESCRIPTION
Net::Hotline::Task is a simple class for storing and retrieving task information, You should never have to create your own Net::Hotline::Task objects when using Net::Hotline::Client. Getting and (to a lesser extent) setting attributes is all that should be necessary. CONSTRUCTION
new NUM, TYPE, START, SOCKET, PATH With no arguments, creates a new Net::Hotline::Task object with all attributes set to undef. With three or four arguments (PATH is optional), creates a new Net::Hotline::Task object with task number NUM, task type TYPE, start time START, user socket number SOCKET, and file path PATH. METHODS
All the Net::Hotline::Task methods are simple attribute get/set routines. If given an argument, they set an attribute. In all cases, they return the current value of the attribute. error EXPR The error state of the task. A true value means there was an error. error_text TEXT The error message text. This only applies if error() returns a true value. finish TIME The time (in platform-native time format, i.e. seconds since the epoch on a Unix system) that a task completed. num NUMBER The unique task number. Task numbers increase sequentially. path PATH The path information associated with a task (if any). In situations where two paths may be associated with a task (a "move file" task, for example), a reference to an array containing the paths will be returned. socket NUMBER The unique user socket number associated with a task (if any). start TIME The time (in platform-native time format) that a task was started. type TASK_TYPE The HTLC_TASK_XXX constant specifying the type of task. These constants are defined in Net::Hotline::Constants, and include: HTLC_TASK_KICK Disconnect a user. HTLC_TASK_LOGIN Log into server. HTLC_TASK_NEWS Get the news. HTLC_TASK_NEWS_POST Post to news. HTLC_TASK_FILE_DELETE Delete a file. HTLC_TASK_FILE_INFO Get file information. HTLC_TASK_FILE_LIST Get a file list. HTLC_TASK_FILE_MKDIR Create a new folder. HTLC_TASK_FILE_MOVE Move a file. HTLC_TASK_SEND_MSG Send a private message. HTLC_TASK_SET_INFO Set file information. HTLC_TASK_USER_INFO Get user information. HTLC_TASK_USER_LIST Get the userlist. AUTHOR
John C. Siracusa (siracusa@mindspring.com) COPYRIGHT
Copyright(c) 1999 by John Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2002-11-27 Net::Hotline::Task(3pm)
All times are GMT -4. The time now is 04:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy