i'm still working with this - have come across this scenario - thanks! what happens if i have a dollar amount without any dollars like this:
If you look at the code I suggested:
You will note that the . in \([0-9.]\) in the 3rd line of this sed command takes care of this case. Are you saying it didn't work when you tried it? I tested cases like this before I posted the code and tried the two lines above in addition to my former tests. It works as desired when I try it.
What OS are you using?
Please use the CODE tag when posting code (as I corrected it in the quote from your last message) instead of using the ICODE tag whenever you are posting long lines that shouldn't be folded. And, never use the ICODE tag to mark multiple lines of code or data that should be displayed as a group.
Hello,
I have a 1.6 GB file that I would like to modify by matching some ids in col1 with the ids in col 1 of file2.txt and save the results into a 3rd file.
For example:
File 1 has 1411 rows, I ignore how many columns it has (thousands)
File 2 has 311 rows, 1 column
Would like to... (7 Replies)
I have file with multiple columns. Column values for a record may be same.
Now i have to replace a column value(this can be same for the other columns) with new value.
File.txt
A,B,C,D,A,B,C,D,A,B,C,D
A,B,C,D,A,B,C,D,A,B,C,D
A,B,C,D,A,B,C,D,A,B,C,D
A,B,C,D,A,B,C,D,A,B,C,D... (1 Reply)
Hi Friends,
This is the only solution to my task. So, any help is highly appreciated.
I have a file
cat input1.bed
chr1 100 200 abc
chr1 120 300 def
chr1 145 226 ghi
chr2 567 600 unix
Now, I have another file by name
input2.bed (This file is a binary file not readable by the... (7 Replies)
Hi,
I am a newbie to awk. Here is my problem. Looking for an awk 1-liner to solve it:
My Computing Environment:
- Solaris10
- I prefer to use csh or sh shells
1. Lets say my input file is File1.dat (delimter = | ) and looks as follows:
(File1.dat)
... (1 Reply)
Hello,
I want to Replace/Remove ^M and the new line that follows it in a delimited file.
So far I have tried following and nothing seems to work for me .
Tr –d ‘\r\n’ < old.dat > new.dat -removes all the linefeed, not just the ones after a ^M.
Sed ‘/^M$/{N; s/.\n//;}’ < old.dat >... (7 Replies)
I have a file like this.
It is tab delimited.
Unfortunately, the missing data was filled in with a period "." (see the leading lines 1-5 columns)
I want to substitute the periods for misisng data with an integer "-999".
however, I do not want the global replace to change the other periods seen... (7 Replies)
Hi,
I have the requirement similar to the one mentioned in the below thread.
https://www.unix.com/unix-for-dummies-questions-and-answers/128155-search-replace-string-only-particular-column-delimited-file.html
The only difference is that I need to change the field for row 1,2 and the last... (14 Replies)
Hi all,
I am fairly new to UNIX and I was wondering if you could provide me with some help! Lets say i have a file as below :
Line 1
Line 2
Line 3
ABC|12|4|2
Now the number 4 in bold, this number will represent the number of row there is in the file excluding the header and footer... (10 Replies)
I have an input file as below
Emp1|FirstName|MiddleName|LastName|Address|Pincode|PhoneNumber
1234|FirstName1|MiddleName2|LastName3| Add1 || ADD2|123|000000000
Output :
1234|FirstName1|MiddleName2|LastName3| Add1 ,, ADD2|123|000000000
OR
1234,FirstName1,MiddleName2,LastName3, Add1 ||... (2 Replies)
Discussion started by: styris
2 Replies
LEARN ABOUT DEBIAN
wcmgr
wcmgr(1) The Webalizer wcmgr(1)NAME
wcmgr - Webalizer (DNS) Cache file Manager
SYNOPSIS
wcmgr [ option ... ] cache-file
DESCRIPTION
wcmgr is a utility program which allows manipulation of the DNS cache files used and produced by The Webalizer. Each record in the cache
file contains an IP address (either IPv4 or IPv6), a timestamp of when the entry was added to the cache, a flag to indicate if the record
contains a resolved name or not, and either the same IP address or a resolved host name. All records are accessed by their IP address.
RUNNING WCMGR
wcmgr was designed to be run from the Unix shell command line. This facilitates its use in shell scripts and other automated processes. A
valid DNS cache file must be specified. Command line options are optional, and if none are given, the default action is to list the con-
tents of the specified cache file.
COMMAND LINE OPTIONS
Different functions are selected by using one or more of the following command line options. If no options are given, the default is to
display the contents of the cache file to the screen (stdout).
-h Display all available command line options and exit.
-v Be verbose.
-V Display the program version and exit. Additional program specific information will be displayed if verbose mode is also used (e.g.
'-vV'), which can be useful when submitting bug reports.
-a address [-n hostname] [-t0]
Add a new record to the cache file. The IP address will be added to the cache file using the current time as the timestamp and
with a resolved name hostname. If -t0 is specified, the record will be considered permanent, and will not be removed (during a
purge) or expired. If a hostname is not specified with the -n option, then the address will be used instead, and the record will
be flagged as unresolved.
-c Create a new cache file. If used alone, this option will create a new, empty cache file. If used with the import option, a new
cache file will be created before importing the data. An error will occur if the file cache-file already exists.
-d address
Delete a record from the cache file using the specified address.
-f address
Find and display information for address from the cache file. A single line similar to that produced by the -l option will be dis-
played unless verbose mode is enabled, in which case a more detailed listing will be produced.
-i name [-c]
Import data into the cache file from the file name. The import file must be a valid tab delimited text file, such as that created
by the export option. If the imported data contains records already present in the cache file, those records will be overwritten
by the imported data. The cache file must exist unless the -c option is specified, in which case, a new cache file will be created
for the imported data.
-l List the contents of the cache file. This is the default action of the program, so does not necessarily need to be specified. If
verbose mode is enabled, a report title, column headers and summary totals will also be displayed.
-p num Purge the cache file of entries older than num days. If num is not specified, then a default of 7 days will be used. if verbose
mode is enabled, each purged record will be printed and the total number of purged records will be displayed.
-s [-t num]
Display cache file information/statistics. If a TTL value (in days) is specified using the -t option, it will be used to calculate
how many records are older than num days, otherwise, the default value of 7 days will be used.
-n name Specify the name to use as the resolved hostname when adding records to the cache.
-t num Time to live (TTL) value. If used along with the -p (purge) option, it specifies how many days a record will remain valid. Any
record that is older than num days is considered expired and will be purged. If used with the -a (add) option, a zero value will
cause the record to be considered permanent.
-x name Export data from a cache file to a tab delimited text file named name. If the text file name exists, it will be overwritten.
BUGS
Please report bugs to the author.
COPYRIGHT
Copyright (C) 1997-2011 by Bradford L. Barrett. Distributed under the GNU GPL. See the files "COPYING" and "Copyright", supplied with all
distributions for additional information.
AUTHOR
Bradford L. Barrett <brad at mrunix dot net>
Version 1.00 12-Jul-2008 wcmgr(1)