Sponsored Content
Full Discussion: File handling
Top Forums Shell Programming and Scripting File handling Post 303042471 by gopishrine on Thursday 26th of December 2019 07:21:27 AM
Old 12-26-2019
Hi,

Thanks for the code. But I am not sure how to use that in my script. Below is my script.

Code:
# Common used variables
set IFILE      = "c:/temp/do_info.$$"
set critical_name_file = "c:/temp/critical_name.txt"

set net_path = "C:\temp"

if ( -e $critical_name_file ) then
	set crt_name = (`cat $critical_name_file`)
else
	PAUSE File with netnames not found: $critical_name_file
	exit
endif

set i = 1
set n = $#crt_name
while ( $i < = $n)
    echo $crt_name[$i]

echo "${crt_name[$i]}" >> $name_path/name.txt
    @ i = $i + 1
end

#***EOF***

The input text file contains the following data
Code:
#L 0.0468011 3.0767717 0.0885828 3.0767717 r8 P 0 57;Net=SCL
#L -0.0885826 3.0767717 -0.0468009 3.0767717 r8 P 0 102;Net=SDA
#L 0.5317584 -0.0911676 0.5317584 -0.0457404 r8 P 0 495;Net=G4
#L 0.5317584 0.6688324 0.5317584 0.7142596 r8 P 0 496;Net=G4

The output text file should have the following data
Code:
SCL
SDA
G4
G4

Let me know how to use code here.

Last edited by rbatte1; 12-27-2019 at 05:34 AM..
 

10 More Discussions You Might Find Interesting

1. Programming

File Handling in C

Hi all, I have a problem in handling files through C. here is the problem im having: i will query the database (for instance consider employees table ) for empno,ename,job,salary fields.The query returns me some 100 of rows. now i need to place them in a file in row wise pattern as they... (3 Replies)
Discussion started by: trinath
3 Replies

2. Programming

file handling

Hi all, I got a little issue here. Imagine that I have more than one process accessing one file. Is it possible to know which process(es) are accessing that file when I open the file?? Thanks for the help. Best regards, Ernesto (2 Replies)
Discussion started by: ninjanesto
2 Replies

3. UNIX for Advanced & Expert Users

File Handling

Hi, I have a log file which runs into 3 to 5 GB. We store this typically for 6 months. When a new month starts we move the previous month into a 9 month back up log (file.9m) and delete the last month of the 9 month back up. Iam using awk to find the data and cat to join the files like... (3 Replies)
Discussion started by: baanprog
3 Replies

4. UNIX for Advanced & Expert Users

please help me in file handling

sir i have to get first line from a file for example >cat file1 abc zxc asd adsf from that file1 i need only first line expected result >abc please help me ! (1 Reply)
Discussion started by: ponmuthu
1 Replies

5. UNIX for Advanced & Expert Users

File handling

my input for a script is another csv file but in that file say 7 lines are there ... how can i get line by line to that input for example : >cat link.csv www.yahoo.com,yahoo www.google.com,google www.unix.com,unix another file in that file i need to ping the above links ... (2 Replies)
Discussion started by: ponmuthu
2 Replies

6. Shell Programming and Scripting

UNIX File handling -Issue in reading a file

I have been doing automation of daily check activity for a server, i have been using sqls to retrive the data and while loop for reading the data from the file for several activities. BUT i got a show stopper the below one.. where the data is getting store in $temp_file, but not being read by while... (1 Reply)
Discussion started by: KuldeepSinghTCS
1 Replies

7. Programming

Perl help for file handling

$# some text $$ some text $@ some text $$. some text Mg1 some text Mg2 some text . . . Mg10 some text The above 10 lines are to be extracted except the lines starting from $#,$$.,... (4 Replies)
Discussion started by: baig.abdul
4 Replies

8. Shell Programming and Scripting

ksh file handling

Specifically on RHEL 5.7. When does the underlying ksh process open and close files? Every time they're accessed, or as little as possible? Say you have some script like: CreateFiles() { grep "<VALUE1>" ${infile} >> ${outfile} grep "<VALUE2>" ${infile} >> ${outfile} ...... (4 Replies)
Discussion started by: CarloM
4 Replies

9. UNIX for Dummies Questions & Answers

File Handling

Hi Team, I am trying to cut a large file into multiple files. It has Header 50,050 records Trailer ------------------------------------------- I need to cut the files into multiple files of 1000 records and should have the same header and trailer as the original files. ... (4 Replies)
Discussion started by: Gurkamal83
4 Replies

10. UNIX for Dummies Questions & Answers

File handling

I have a file 1 298167 298168 1093209 1093210 1422663 I want to write a code where in I want to read contents of above file like first read is 1 second read is 298167 Substract second read from first and if this is greater than or less than 99,999. Similarly I want to traverse thru... (3 Replies)
Discussion started by: Guru148
3 Replies
Net::LDAP::Control::EntryChange(3)			User Contributed Perl Documentation			Net::LDAP::Control::EntryChange(3)

NAME
Net::LDAP::Control::EntryChange - LDAPv3 Entry Change Notification control object SYNOPSIS
use Net::LDAP; use Net::LDAP::Control::PersistentSearch; use Net::LDAP::Constant qw(LDAP_CONTROL_ENTRYCHANGE); $ldap = Net::LDAP->new( "ldap.mydomain.eg" ); $persist = Net::LDAP::Control::PersistentSearch->new( changeTypes => 15, changesOnly => 1, returnECs => 1 ); $srch = $ldap->search( base => "cn=People,dc=mydomain,dc=eg", filter => "(objectClass=person)", callback => &process_entry, # call for each entry control => [ $persist ] ); die "error: ",$srch->code(),": ",$srch->error() if ($srch->code()); sub process_entry { my $message = shift; my $entry = shift; my ($control) = $message->control(LDAP_CONTROL_ENTRYCHANGE); print $control->changeType()." ".$entry->dn()." "; } DESCRIPTION
"Net::LDAP::Control::EntryChange" provides an interface for the creation and manipulation of objects that represent the "EntryChangeNotification" control as described by draft-smith-psearch-ldap-03.txt. CONSTRUCTOR ARGUMENTS
In addition to the constructor arguments described in Net::LDAP::Control the following are provided. changeType An integer value telling the type of LDAP operation that the entry has undergone. It is one of the following values (which represent the LDAP operations indicated next to them): 1 = add 2 = delete 4 = modify 8 = modDN previousDN When changeType is 8 (for modDN) this parameter tells the entry's DN before the modDN operation. In all other cases this value is not defined. changeNumber This is the change number according to <draft-good-ldap-changelog-03.txt> assigned by a server for the change. If a server supports an LDAP Change Log it should include this field. Usually you do not need to create a "Net::LDAP::Control::EntryChange" control yourself because it is provided by the server in response to an option with the "Net::LDAP::Control::PersistentSearch" control. METHODS
As with Net::LDAP::Control each constructor argument described above is also available as a method on the object which will return the current value for the attribute if called without an argument, and set a new value for the attribute if called with an argument. SEE ALSO
Net::LDAP, Net::LDAP::Control, Net::LDAP::Control::PersistentSearch AUTHOR
Peter Marschall <peter@adpm.de>, based on Net::LDAP::Control::Page from Graham Barr <gbarr@pobox.com> and the preparatory work of Don Miller <donm@uidaho.edu>. Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org> COPYRIGHT
Copyright (c) 2004 Peter Marschall. 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.18.2 2013-07-21 Net::LDAP::Control::EntryChange(3)
All times are GMT -4. The time now is 04:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy