Hi All,
Please can you help me with below, i have a file with records ( eg of one record below)
Record R1 - The field separtaor between records is | (Pipe)
Now i want to do the following for each record in the file
if there is any field ( lets say field is F1) in the record having \r\n ( carriage return and new line coming together ) or single quotes i have to do the following
Replace single quotes with Double quotes
and put the entire field in opening and closing double quotes like this "F1"
so the output should be like for record R1
Moderator's Comments:
Please use CODE tags as required by forum rules!
Enclosing the ENTIRE post in CODE tags isn't the right way either!
Last edited by RudiC; 11-17-2016 at 06:01 AM..
Reason: Changed CODE tags' positions.
thank u optimus,but one more dout..it might be silly..how do i get the value in the file that should be replaced..while running the script..its an numeric value..that i want to change..
when i used sed for replacement ie.
sed s/521000/100/p
with print option it is printing... (4 Replies)
Hi ,
I have some data in my file(properties.txt) like this.
# agent.properties
agent.dmp.Location=
agent.name=
I need to relpace the
agent.dmp.location with agent.dmp.Location = /opt/VRTS/vxvm
I am using the follwing to replace the string
AGENT_NAME=snmp... (2 Replies)
Hi there,
I have a file generated by a windows registry (it's unicode) and can't get to do some replacements on it. I want to join lines that end with backslash with the next one.
santiago@ks354286:~$ cat win.reg
ÿþWindows Registry Editor Version 5.00
... (10 Replies)
Hi,
I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database.
For instance:
USER CITY
--------- ----------
A CITY_A
B CITY_B
C ... (2 Replies)
Hi all,
I have two files, one is a base file and the other is a dependency file.
I need to replace a section in the base file (File A) with a section from the dependency file (File B), for example:
File A:
...
<TagName>
<TagA>MyBaseFile</TagA>
<TagB>MyBaseFileID</TagB>
</TagName>... (5 Replies)
HI Guys ,
Using UNIX ,I intend to check with correct file pattern Access_file_Record.YYYYMM in path /tmp
If the file exist in correct format come out from code .
If not found check with different file patterns for same month period YYYYMM ( Like Access_file_Record_YYYYMM.txt or... (8 Replies)
Hello scriping expert friends,
I have 2 requirements on replacing fields of text files:
I have lot of data with contents like below:
Requirement-1:
The digit after 0 should always be changed to 1 (3 Replies)
I had a doubt regarding how the file size changes and needed some advice on the same
So I have this file say abc.txt.. Size was 10000. Now inside the file when I go and I replace all the number 7 numerals with number 4 file size changed to 9984. Any idea why and how ?? (8 Replies)
I want to replace a string by contents of file.
I am trying the following sed command:
cat sample | sed "s^<enter description here>^`cat details`^"
But it is not working.
a=`cat details` and using $a will not help since it will affect the whitespaces.
What am I missing in the above sed... (5 Replies)
Dear all,
I have a "SQL request" in a file: that request include different "host variable" and I would like to substitute the different "host variable" by their respective content before executing the request.
For example:
$ echo $SHELL
/bin/bash
$ cat dae2.txt
DELETE FROM ... (11 Replies)
Discussion started by: dae
11 Replies
LEARN ABOUT SUNOS
wracct
wracct(1M)wracct(1M)NAME
wracct - write extended accounting records for active processes and tasks
SYNOPSIS
/usr/sbin/wracct -i id_list [-t record_type] {process | task}
The wracct utility allows the administrator to invoke the extended accounting system, if active, to write intermediate records representing
the resource usage of a selected set of processes or tasks. For tasks, a record_type option is also supported, allowing the administrator
to request the writing of:
o an interval record, which reflects task usage since a previous interval record (or since task creation if there is no interval
record), or
o a partial record, which reflects usage since task creation.
The following options are supported:
-i id_list Select the IDs of the tasks or processes to write records for. Specify id_list as a comma- or space-separated list of IDs,
presented as a single argument. For some shells, this requires appropriate quoting of the argument.
-t record_type Select type of record to write for the selected task or process. For tasks, record_type can be partial or interval. partial
is the default type, and the only type available for process records.
The following operands are supported:
process Treat the given ID as a process ID for the purposes of constructing and writing an extended accounting record.
task Treat the given ID as a task ID for the purposes of constructing and writing an extended accounting record.
Example 1: Writing a Partial Record
Write a partial record for all active sendmail processes.
# /usr/sbin/wracct -i "`pgrep sendmail`" process
Example 2: Writing an Interval Record
Write an interval record for the task with ID 182.
# /usr/sbin/wracct -t interval -i 182 task
The following exit values are returned:
0 Successful completion.
1 An error occurred.
2 Invalid command line options were specified.
3 Pertinent components of extended accounting facility are not active.
/var/adm/exacct/task
/var/adm/exacct/proc Extended accounting data files.
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
acctadm(1M), attributes(5)
13 July 2005 wracct(1M)