01-14-2008
Formatting a file.
I want to format a file to limit record length = 100, in each line.
Any idea how i can do this?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have been trying to format a file using sed. I can't seem to get the syntax right. I want to append the next line delemited by a comma or a comma and double quotes. Here is an example of the file I'm tring to format:
Before formatting:
00324
03A0312
BRI-u24
0000324
01
H-12... (4 Replies)
Discussion started by: cstovall
4 Replies
2. Shell Programming and Scripting
I have a file with following file format -
DMCRH|||83000171|||14022008||0430|||8956612.23|J|||3571235|1378452|23468|6894|9234|
DMCRH|||83000215|||15092007||0480|||121.33|J|||LineID003|RefNumSP003|RefNumMem003|0004|0003|
What i need done is -
1. Cut the firt four digits of the date (eg 1402... (3 Replies)
Discussion started by: divz
3 Replies
3. Shell Programming and Scripting
Hi,
Need to delete all the records prior to pattern (INSERT/UPDATE/DELETE). If ' is available, then need to retain it.
Input
======================
l_s := ' INSERT INTO TEST'
l_P PD := ' UPDATE INTO TEST'
l_D := ' DELETE INTO TEST'
This is test
Input
======================... (1 Reply)
Discussion started by: saurabhbaisakhi
1 Replies
4. Shell Programming and Scripting
Hi,
Need to delete all the records prior to pattern (INSERT/UPDATE/DELETE). If ' is available, then need to retain it.
Input
======================
l_s := ' INSERT INTO TEST'
l_P PD := ' UPDATE INTO TEST'
l_D := ' DELETE INTO TEST'
This is test
Output
======================... (1 Reply)
Discussion started by: saurabhbaisakhi
1 Replies
5. Shell Programming and Scripting
I need to count the number of lines between two sets of pattern in a file and delete those lines from that file e.g
From jyotiv@yahoo.com
test
test2
test3
test4
test5
test6
From Jyotiv@yahoo.com
So count lines from test to test6 and delete it from the start of file till next From... (1 Reply)
Discussion started by: jyotiv
1 Replies
6. Shell Programming and Scripting
Hi,
I have a file which contains data in this format
# User@Host: abc @ Id: 0000000
# Query_time: 0.000070 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0
SET timestamp=00000000;
SELECT @@version, @@version_comment;
# User@Host: abcd @ Id: 00000000
# Query_time: 0.000228 ... (6 Replies)
Discussion started by: arijitsaha
6 Replies
7. Shell Programming and Scripting
Hi,
I have requirement to format the file.My input file tab(\t) saperated.
File format is:-
93 WARNING Sat Mar 17 20:31:59 2012
Sequential_File_0,0: Missing record delimiter "\r\n", saw EOF instead
94 WARNING Sat Mar 17 20:31:59 2012
Sequential_File_0,0: Import... (4 Replies)
Discussion started by: prasson_ibm
4 Replies
8. Shell Programming and Scripting
Hi,
I have a file in the following format.
cat input
name: abcd_ef_1
234:343:343
343:234:343
name : abcdef_2
2343:2343:3434:
w3243:wr43:2343
2343:2343:23343:3432
2343:34234:2343
name: 3432_343_3
23432:2343
2343:23432:32432
23432:23432:3432432
As you can see... (2 Replies)
Discussion started by: jpkumar10
2 Replies
9. Shell Programming and Scripting
I have to write a program to read data from files and then format into another file. However, I face a strange problem related to control character that I can't understand and solve.
The source file is compose of many lines with such format:
T_NAME|P_NAME|P_CODE|DOCUMENT_PATH|REG_DATE
... (3 Replies)
Discussion started by: hk6279
3 Replies
10. UNIX for Dummies Questions & Answers
Hi All,
i have a requirement where i need to format the input RAW file ( which is CSV) by using another mapping file(also CSV file). basically i am getting feed file with dynamic headers by using mapping file (in that target field is mapped with source filed) i have to convert the raw file into... (6 Replies)
Discussion started by: ravi4informatic
6 Replies
LEARN ABOUT OPENSOLARIS
audit
audit(2) System Calls audit(2)
NAME
audit - write a record to the audit log
SYNOPSIS
cc [ flag ... ] file ... -lbsm -lsocket -lnsl [ library... ]
#include <sys/param.h>
#include <bsm/libbsm.h>
int audit(caddr_t record, int length);
DESCRIPTION
The audit() function queues a record for writing to the system audit log. The data pointed to by record is queued for the log after a mini-
mal consistency check, with the length parameter specifying the size of the record in bytes. The data should be a well-formed audit
record as described by audit.log(4).
The kernel validates the record header token type and length, and sets the time stamp value before writing the record to the audit log.
The kernel does not do any preselection for user-level generated events. If the audit policy is set to include sequence or trailer tokens,
the kernel will append them to the record.
RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.
ERRORS
The audit() function will fail if:
E2BIG The record length is greater than the maximum allowed record length.
EFAULT The record argument points outside the process's allocated address space.
EINVAL The header token in the record is invalid.
ENOTSUP Solaris Audit is not defined for this system.
EPERM The {PRIV_PROC_AUDIT} privilege is not asserted in the effective set of the calling process.
USAGE
Only privileged processes can successfully execute this call.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
bsmconv(1M), audit(1M), auditd(1M), svcadm(1M), auditon(2), getaudit(2), audit.log(4), attributes(5), privileges(5)
NOTES
The functionality described in this man page is available only if the Solaris Auditing has been enabled and the audit daemon auditd(1M) has
not been disabled by audit(1M) or svcadm(1M). See bsmconv(1M) for more information.
SunOS 5.11 16 Apr 2008 audit(2)