02-12-2013
Thanks a lot for the scripts! They work perfectly on the example file. However, they do nothing for my big file. I am not sure, but may be it is the field separator? the big file's columns are separated by a space, not tab; could that affect the script?
Many thanks in advance!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I've got a data file like the following format.
196004010000 196004020000 8192 24 ueaag 98.793 18.750 20 ---- - 36 23 9999 314.161773681641
196004020000 196004030000 8192 24 ueaag 98.793 18.750 20 ---- - 36 23 9999 314.71533203125
196004030000 196004040000 8192 24... (7 Replies)
Discussion started by: su_in99
7 Replies
2. Shell Programming and Scripting
Hi,
I have file 1.txt with following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433
**
**
**
In file 2.txt I have the following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433... (4 Replies)
Discussion started by: imas
4 Replies
3. UNIX for Dummies Questions & Answers
Hii I have a file which contains huge amounts of data.I just want to delete last 3 columns in the without changing its format.The file contains data as shown below
PDE 2001 10 29 202148.60 38.92 24.20 33 4.8 MLATH .F. .......
PDE 2001 10 29 203423.57 38.88 24.41 33 3.7 MLATH... (3 Replies)
Discussion started by: reva
3 Replies
4. UNIX for Dummies Questions & Answers
I have this space delimited large text file with more than 1,000,000+ columns and about 100 rows. I want to delete all the columns that start with NA such that:
File before modification
aa bb cc NA100 dd
aa b1 c2 NA101 de
File after modification
aa bb cc dd
aa b1 c2 de
How would I... (3 Replies)
Discussion started by: evelibertine
3 Replies
5. Shell Programming and Scripting
Hello sed gurus. I am using ksh on Sun and have a file created by concatenating several other files. All files contain header rows. I just need to keep the first occurrence and remove all other header rows.
header for file
1111
2222
3333
header for file
1111
2222
3333
header for file... (8 Replies)
Discussion started by: gary_w
8 Replies
6. Shell Programming and Scripting
Hi All
I am having pipe seperated inputs like
Adam|PeteR|Josh|PEter
Nick|Rave|Simon|Paul
Steve|smith|PETER|Josh
Andrew|Daniel|StAlin|peter
Rick|PETer|ADam|RAVE
i want to repleace all the occurrence of peter (in any case pattern PeteR,PEter,PETER,peter,PETer) with Peter so that output... (5 Replies)
Discussion started by: sudeep.id
5 Replies
7. UNIX for Dummies Questions & Answers
An extension from an earlier question. Now need a sed script to delete columns 7,15 and 16 from an example txt below..
Again, thanks in advance.
98M-01.WAV,98M,01,00:00:49,01:07:36:00,"MIX",,"BOOM-MKH50",,,,,,,,,,"",
98L-01.WAV,98L,01,00:00:51,01:01:45:00,"MIX",,"BOOM-MKH50",,,,,,,,,,"", (7 Replies)
Discussion started by: Vrc2250
7 Replies
8. Shell Programming and Scripting
i have a table like this:
id, senderNumber, blacklist
-----------------------------
1 0835636326 Y
2 0373562343 Y
3 0273646833 Y
and I want to delete automatically if a new inserted row on another table consist anything on senderNumber column above using a BASH Script
I... (9 Replies)
Discussion started by: jazzyzha
9 Replies
9. Shell Programming and Scripting
I had a spot of trouble coming up with a title, hopefully you'll understand once you read my problem... :)
I have the output of an ldapsearch that looks like this:
dn: cn=sam,ou=company,o=com
uidNumber: 7174
gidNumber: 49563
homeDirectory: /home/sam
loginshell: /bin/bash
uid: sam... (2 Replies)
Discussion started by: samgoober
2 Replies
10. Shell Programming and Scripting
I have a file
Line 1 a
Line 22
Line 33
Line 1 b
Line 22
Line 1 c
Line 4
Line 5
I want to delete all lines before last occurrence of a line which contains something which is defined in a variable. Say a variable var contains 'Line 1', then I need the following in the output.
... (21 Replies)
Discussion started by: Soham
21 Replies
LEARN ABOUT SUNOS
streadd
strccpy(3GEN) String Pattern-Matching Library Functions strccpy(3GEN)
NAME
strccpy, streadd, strcadd, strecpy - copy strings, compressing or expanding escape codes
SYNOPSIS
cc [ flag ... ] file ... -lgen [ library ... ]
#include <libgen.h>
char *strccpy(char *output, const char *input);
char *strcadd(char *output, const char *input);
char *strecpy(char *output, const char *input, const char *exceptions);
char *streadd(char *output, const char *input, const char *exceptions);
DESCRIPTION
strccpy() copies the input string, up to a null byte, to the output string, compressing the C-language escape sequences (for example,
,
01) to the equivalent character. A null byte is appended to the output. The output argument must point to a space big enough to accommo-
date the result. If it is as big as the space pointed to by input it is guaranteed to be big enough. strccpy() returns the output argument.
strcadd() is identical to strccpy(), except that it returns the pointer to the null byte that terminates the output.
strecpy() copies the input string, up to a null byte, to the output string, expanding non-graphic characters to their equivalent C-language
escape sequences (for example,
, 01). The output argument must point to a space big enough to accommodate the result; four times the
space pointed to by input is guaranteed to be big enough (each character could become and 3 digits). Characters in the exceptions string
are not expanded. The exceptions argument may be zero, meaning all non-graphic characters are expanded. strecpy() returns the
output argument.
streadd() is identical to strecpy(), except that it returns the pointer to the null byte that terminates the output.
EXAMPLES
Example 1: Example of expanding and compressing escape codes.
/* expand all but newline and tab */
strecpy( output, input, "
" );
/* concatenate and compress several strings */
cp = strcadd( output, input1 );
cp = strcadd( cp, input2 );
cp = strcadd( cp, input3 );
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
string(3C), strfind(3GEN), attributes(5)
NOTES
When compiling multi-thread applications, the _REENTRANT flag must be defined on the compile line. This flag should only be used in multi-
thread applications.
SunOS 5.10 29 Dec 1996 strccpy(3GEN)