07-01-2012
look for specific values in a file and rename file with value found
Hi,
i have a file with some data ..look for some specific value in the file and if found that value rename the file with the value found in the file..
ex..
File.txt
1236 43715825601ANDERSSON,
1236 437158256031963040120060901200609010000000
1236 43715825604123 MCCL AVE UPPER
1236 43715825605AMSTERDAM NY 120100000
1236 43715825611A756
1236 43715825633100620120215I00000007819GOR
1236 43715825633100620120215F00000020850GOR
1237 11868184001BEAUREGARD, TAMMY L 0F
1237 11868184003196812272001113020011130000000000000000000
1237 118681840041566 SALT SPRINGVILLE
1237 11868184005FORT PLAIN NY 133390000
1237 11868184011A756
need to fine the value A756(in place of A756 we can have any of the value from these...A756 or B234 or C987 ) if we found any of the value with in the file the file name should be changed to File_ValueFound.txt
ex: File_A756.txt
the place of value is same always..
Thanks in advance..
Siva Santosh
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi everyone,
Can anyone guide me on how to search through a huge file and look on specific column and if it finds a discrepancy on that column that does not conform to the specified criteria,
ie
(1) Numeric and (3) alpha chars F123 or G333..etc, etc!
then idientify it and redirect... (3 Replies)
Discussion started by: Gerry405
3 Replies
2. Shell Programming and Scripting
Hi Friends,
I have a file with the following values..
xyz.txt,12345.xml
abc.txt,04567.xml
cde.txt,12134.xml
I would like to extract all the 2nd column values twice as shown in the example like
12345,12345.xml
04567,04567.xml
12134,12134.xml
Please advice!!
In the formus one of... (7 Replies)
Discussion started by: techmoris
7 Replies
3. Shell Programming and Scripting
Hi all,
I am working on a small prog..
i have a file.txt which contains random data...
K LINES V4 ADD CODE `COMPANY` ADD CODE `DISTRIBUTOR` SEQ NAME^K LINES V5 SEQ NAME^K LINES V6 ADD `PACK-LDATE` SEQ NAME^K^KCOMMAND END^KHEADINFO... (1 Reply)
Discussion started by: mukeshguliao
1 Replies
4. Shell Programming and Scripting
Hello,
I am new to shell
I have a folder which contains a list of files, all the files contain the separator :
I need to replace this character for all the filenames (by batch)
ex: hello:world should become hello-world
please help
Thanks (3 Replies)
Discussion started by: sikilaklak
3 Replies
5. Shell Programming and Scripting
Hello
I am making a script where I need to rename the files but with different names.The file name could be change according to the product
I made a logic but that is not working properly
arr=$(echo a@b@c | tr "@" "\n")
echo $arr
output is a b c
arry=$(echo d@e@f | tr "@" "\n")
... (4 Replies)
Discussion started by: anuragpgtgerman
4 Replies
6. Shell Programming and Scripting
Dear all,
I have a specific problem that i cannot solve and I hope someone here can help me. :)
I have two text files with one column of values.
Example:
File1:
67
94
95
.
.
File2
0.1
0.003
0.5
.
. (3 Replies)
Discussion started by: Higgo
3 Replies
7. Shell Programming and Scripting
Dear all,
I have a problem that i cannot solve and I hope someone here can help me.
I have a huge tab delimited text file with two columns in relation. The values in the first column can be redundant and one copy of that value can exist in the second column.
My question is how to simplify... (5 Replies)
Discussion started by: Higgo
5 Replies
8. Shell Programming and Scripting
I have a specific set (all ending with .bam) of downloaded files in a directory /home/cmccabe/Desktop/NGS/API/2-15-2016. What I am trying to do is use a match to $2 in name to rename the downloaded files. To make things a more involved the date of the folder is unique and in the header of name... (1 Reply)
Discussion started by: cmccabe
1 Replies
9. Shell Programming and Scripting
I am trying to rename all text files in a directory that match a pattern. The current command below seems to be using the directory path in the name and since it already exists, will not do the rename. I am not sure what I am missing? Thank you :).
Files to rename in... (3 Replies)
Discussion started by: cmccabe
3 Replies
10. Shell Programming and Scripting
I am trying to use awk to change a specific string in a field, if it is found, to another value. In the tab-delimited file the text in bold in $3 contains the string 23, which is always right before a ., if it is present.
I am trying to change that string to X, keeping the formatting and the... (3 Replies)
Discussion started by: cmccabe
3 Replies
LEARN ABOUT DEBIAN
p10cfgd
P10CFGD(1) General Commands Manual P10CFGD(1)
NAME
p10cfgd - remote configuration daemom for Gracilis PackeTen
SYNOPSIS
p10cfgd [IP_PORT]
COPYRIGHT
Copyright (c) 1993 by Colorado Digital Eclectics (CODE)
All rights reserved.
DESCRIPTION
Rmtcfgd is a server program used to send configuration files to a Gracilis PackeTen. It can be run in background or it can be run by
inetd. If p10cfgd is to be run by inetd, add the following line to /etc/services
rmtcfg 1236/tcp # Remote Configuration of PackeTen
and add the following to /etc/inetd.conf
# Remote configuration service for PackeTen
rmtcfg stream tcp nowait root /usr/bin/p10cfgd p10cfgd
P10cfgd normally does not require the IP_PORT parameter. It listens for connections on IP Port 1236 as a default.
The program will send on a line by line basis the file requested by the client that connects on the IP Port. The only expected input from
the client is the file name. When the file has been sent, the connection is closed. The requested file must be in the directory
/etc/p10cfgd.
Rmtcfgd maintains a log of its activity in the file /var/log/p10cfgd.log. Program startup and all connections are logged in the file with
GMT time stamps. The file is opened in append mode.
The protocol used by the PackeTen is very simple. The PackeTen opens a tcp connection to port 1236 on a host system. Once the connection
is made, the PackeTen sends the name of the file it wants to the host. The host then opens the file and sends it line by line to the Pack-
eTen until all lines have been sent. The files to be transfered must be plain text files and each line must have at least one character in
addition to the newline at the end. P10cfgd replaces all blank lines with lines that contain two spaces. If you wish to send a blank
line, to stop loading of part of a LocalInfo file for example, place an underscore '_' at the begining of the line. The entire contents of
the line will be deleted and a blank line will be sent to the client. At the end of the file, the server sends a time command ( time MMD-
DYYHHMM ) with the UTC time on the server. This will either set the time on the PackeTen or add a time stamp to the LocalInfo file. The
server then closes the connection.
The remote configuration command used on the PackeTen is
rmtcfg <server_host> <filename> [options]
The valid options are
-t <timeout in seconds> default is 60 sec
-p <IP port #> default is 1236
-i the file is for LocalInfo
-h <secondary server> if the primary does not answer
The rmtcfg commands would be placed in to the EEPROM on the PackeTen so that they would be executed during a reboot. The information
stored in the EEPROM should include enough information to set the PackeTen up to allow communications with the primary and the secondary
server. This would include commands to set MYCALL and the IP_ADDRESS, to attach an interface to the channel with the server, routing
information and so forth. A sample EEPROM configuration for a PackeTen, empire.wd0fhg.ampr.org [44.32.0.32], that gets its configuration
from a remote system winfree.n3eua.ampr.org [44.32.0.2], over a 9600 baud ax25 path would be:
# first the general setup of the PackeTen
ee hostname gw.wd0fhg
ee sitename empire
ee ipaddr 44.32.0.32
ee mycall WD0FHG
# Then we attach a 9600 ax25 interface as ax1
ee attach sync302 1 hdx ax25 ax1 8192 256 9600 ext ext nrzi
# and set the default route to send every thing out ax1
ee route add default ax1 44.32.0.1
ee password sure-thing
#
# Now we will ask for the remainder of the setup
# from the server winfree.n3eua.ampr.org [44.32.0.2]
# Note that we have a secondary server available at
# [44.20.0.195] that would be used if winfree is down.
# first the Local Information file
ee com 0 rmtcfg 44.32.0.2 empire.info -i -h 44.20.0.195
# and then the remaining configuration command file
ee com 1 rmtcfg 44.32.0.2 empire.cfg -h 44.20.0.195
#
ee save
# end-of-eeprom setup
Rmtcfgd started life as the simple server program in PERL by Larry Wall and R.L. Schwartz published by ORA,Inc.
ENVIRONMENT
No environment variables are used.
FILES
/etc/p10cfgd/* - files that can be accessed remotely
/var/log/p10cfgd.log - p10cfgd log file
AUTHOR
John Conner, WD0FHG, conner@empire.com
hacked on by Bdale Garbee, N3EUA, bdale@gag.com.
SEE ALSO
Gracilis, Inc. PackeTen Manual and NOS User's Manual
DIAGNOSTICS
Complains if it can't open a file to remote client and to log file.
7th Edition July 29, 1993 P10CFGD(1)