I have a 30 column tab delimited record file. I need to extract the first 10column. The following command to cut was not working
cut -f 1-10 -d "\t" filename.
Could any one keep on this .
Thanks in Advance (4 Replies)
Hi,
I need to append the data in to a file by using tab delimiter.
eg:
echo "Data1" >> filename.txt
echo "\t" >> filename.txt (its not working)
echo "Data2" >> filename.txt.
the result sould be like this.
Data1 Data2 (6 Replies)
Hi All,
i have a file test.txt as shown below,
1,test,test111
2,rest,rest222
i want to replace the commas by tab delimiter..,
it should be like,
1 test test111
2 rest rest222
i tried the following code,
sed 's/,/\\t/g' test.txt >> ouptut.txt (9 Replies)
Hello,
Is there a direct command to check if the delimiter in your file is a tab or a space? And how can they be converted from one to another.
Thanks,
G (4 Replies)
I have a csv file and there is a problem which I need to resolve.
Column1,Column2,Colum3,Column4
,x,y,z
,d,c,v
t,l,m,n
,h,s,k
,k,,y
z,j, ,p
Now if you see column1 for row 1 and row 4 though they are null there is a space but in case of row2 and row 5 there is no space.
I want row... (3 Replies)
Hi,
Requirement: Exporting data from Oracle to UNIX into "Comma" delimiter.
Help Needed: I was able to connect to Oracle and import the data. But please let me know while importing the data I need to make it into Comma delimiter flat file.
For Example:
Source Data -
100 ABC TLead... (6 Replies)
The input file is as below
AR,age,marks,roll,section,evin,25,80,456,A,atch,23,56,789,B,eena,24
,78H245,C,Ps,ot,ecessary,hat,ame comes first then age and rest AR
AZ,kevin,25,80,456,A,Satch,23,56,789,Satch,23,56,789,B,Meena,24,78,H245,C,AZ
................
................
I am writting... (8 Replies)
Discussion started by: millan
8 Replies
LEARN ABOUT HPUX
priv_set_to_str
priv_str_to_set(3) Library Functions Manual priv_str_to_set(3)NAME
priv_str_to_set(), priv_set_to_str() - privilege name to set conversion function
SYNOPSIS
Parameters
priv_list The list of privilege names, passed as a string, separated by one or more characters from delimiter. It may also
contain the compound privileges (basic, basicroot, and policy).
delimiter Separates the privileges in priv_list.
index_ptr If an error occurs while parsing the list of privilege names, the pointer pointed to by index_ptr is set to point to
the remainder of the string after the error occurred, so long as index_ptr is not a NULL pointer.
delimiter Separates the individual privilege names by any of the specified characters. If delimiter is a NULL character, the
default delimiter of comma is used.
flag Bit mask with the following bit positions defined: Exactly one of the two flags must be passed. When flag is the
resulting string uses the compound privileges and to arrive at a short representation.
priv_vec Specifies privilege set.
DESCRIPTION
priv_str_to_set Conversion
converts a list of privilege names to a privilege set.
priv_list is a string consisting of privilege names and/or compound privileges. The individual elements in the string are separated by one
or more characters of delimiter .
Any privilege in the list priv_list can be optionally preceded by an exclamation mark to be interpreted as removal. For example, means all
privileges in the compound privilege except the privilege.
The string is case-insensitive. prefix is optional to a privilege name. For example, and all have the same meaning.
priv_list is interpreted left to right, so the string is the same as an empty list of privileges, while is the same as
For a list of valid privileges (both individual privileges and compound privileges), see privileges(5).
priv_set_to_str Conversion
converts a privilege set to a string of privilege names separated by the character specified by delimiter .
RETURN VALUE
and return the following values:
pointer Successful completions. Returns a non-null pointer. The caller of is responsible for freeing the result using the The
caller of is responsible for freeing the result using the
NULL pointer
Function failed. Returns a null pointer and sets to indicate the error .
ERRORS
If any of the following conditions occur, the functions fail and set
Cannot allocate enough memory for the given data.
One or more arguments are invalid.
EXAMPLES
#include <stdio.h>
#include <sys/types.h>
#include <sys/privileges.h>
#define priv_list "PRIV_CHOWN,PRIV_CHROOT,PRIV_DACREAD"
main()
{
char *index;
priv_set_t * priv_vector;
if ( (priv_vector = priv_str_to_set( priv_list,
NULL,
&index)) == NULL )
{
perror("priv_str_to_set Failed");
if (index)
printf("Invalid privilege name starting at %s
", index);
exit(1);
}
printf("The privileges in the given privilege vector are %s
",
priv_set_to_str( priv_vector, NULL, PRIV_STR_SHORT) );
}
DEPENDENCIES
and are both part of the library.
SEE ALSO privset_free(3), privileges(5).
priv_str_to_set(3)