Can someone help me on this?
I'm creating an Insert stmt script but Oracle does not accept blanks values. How can I insert the word null between two commas? I'm guessing awk or sed.
Is there a good post or site with easy to understand info on awk and sed? I'm really new to unix scripts :D
... (5 Replies)
Does anyone know how will I make awk's split work with empty or null separator/delimiter?
echo ABCD | awk '{ split($0,arr,""); print arr; }'
I need output like:
A
B
C
D
I am under HP-UX (5 Replies)
Hi
Can somebody help me with solution for this PLEASE?
I have a flat file and need to insert delimiters at fixed positions in all the lines so that I can easily convert into EXCEL with columns defined as per their width.
For Example
Here is the file
{
kkjhdhal
sdfewss
sdtereetyw... (7 Replies)
I can't seem to get sed to allow me to insert text in the first line of an empty file. I have a file.txt that is a 0 byte file. I want sed to insert " fooBar" onto the first line. I've tried a few options and nothing seems to work. They work just fine if there's text in the file tho. Help? (4 Replies)
I have a data file that I would like to add delimiters to.
Example:
Turn This:
20110624000744000693000704000764
Into This:
20110624,000744,000693,000704,000764
I found this link but the only issue is I do not know how many colums I will have. The first field would needs to be 8... (9 Replies)
I have an awk script to extract data from several files and create output in the following format as a csv file:
xxxx 01/04/12 0001 0
When data is present, I have a file. When no data is available in the input files, I would still like to create a file that looks like this:
xxxx... (1 Reply)
Hi,
I have a tab delimited flat file, for example shown below
Name Desg Loc
a b c
d e fI want to insert an empty column inbetween the column Desc and Loc, the result should be like shown below:
Name LName Desg Loc
a b c
d e ... (6 Replies)
Greetings:
I generate an empty flat file just fine when there's no data returned from my process, as the customer wants one always (using the 1st line of the below script). However, they also want at least the column names in this flat file (row 1, the only row to be in the emply file). I'm... (7 Replies)
Hello all,
I have an unstructured file with space as delimiter , which I want to structure.
The output file should actually have only 5 columns with tab as delimiter.
The 4th column can have only 3 values ( biological_process , cellular_component , molecular_function )
Here is how the... (12 Replies)
Hi All ,
I have pipe delimiter file with 11 columns . I need to insert 4 empty columns after column 10 . and After 11 column I need to insert a column which is having the same value for all the rows .
My file
1|2|3|4|5|6|7|8|9|10|11
New file
... (11 Replies)
Discussion started by: Hypesslearner
11 Replies
LEARN ABOUT SUNOS
fmlcut
fmlcut(1F) FMLI Commands fmlcut(1F)NAME
fmlcut - cut out selected fields of each line of a file
SYNOPSIS
fmlcut -clist [filename...]
fmlcut -flist [-dchar] [-s] [filename...]
DESCRIPTION
The fmlcut function cuts out columns from a table or fields from each line in filename; in database parlance, it implements the projection
of a relation. fmlcut can be used as a filter; if filename is not specified or is -, the standard input is read. list specifies the fields
to be selected. Fields can be fixed length (character positions) or variable length (separated by a field delimiter character), depending
on whether -c or -f is specified.
Note: Either the -c or the -f option must be specified.
OPTIONS
list A comma-separated list of integer field numbers (in increasing order), with optional - to indicate ranges. For example: 1,4,7;
1-3,8; -5,10 (short for 1-5,10); or 3- (short for third through last field).
-clist If -c is specified, list specifies character positions (for instance, -c1-72 would pass the first 72 characters of each line).
Note: No space intervenes between -c and list.
-flist If -f is specified, list is a list of fields assumed to be separated in the file by the default delimiter character, TAB, or by
char if the -d option is specified. For example, -f1,7 copies the first and seventh field only. Lines with no delimiter characters
are passed through intact (useful for table subheadings), unless -s is specified. Note: No space intervenes between -f and list.
The following options can be used if you have specified -f.
-dchar If -d is specified, char is the field delimiter. Space or other characters with special meaning to FMLI must be quoted.
Note: No space intervenes between -d and char . The default field delimiter is TAB.
-s Suppresses lines with no delimiter characters. If -s is not specified, lines with no delimiters will be passed through
untouched.
EXAMPLES
Example 1: Getting login IDs and names
The following example gets the login IDs and names.
example% fmlcut -d: -f1,5 /etc/passwd
Example 2: Getting the current login name
The next example gets the current login name.
example% `who am i | fmlcut -f1 -d" "`
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO fmlgrep(1F), attributes(5)DIAGNOSTICS
fmlcut returns the following exit values:
0 when the selected field is successfully cut out
2 on syntax errors
The following error messages may be displayed on the FMLI message line:
ERROR: line too long
A line has more than 1023 characters or fields, or there is no new-line character.
ERROR: bad list for c/f option
Missing -c or -f option or incorrectly specified list. No error occurs if a line has fewer fields than the list calls for.
ERROR: no fields
The list is empty.
ERROR: no delimiter
Missing char on -d option.
NOTES
fmlcut cannot correctly process lines longer than 1023 characters, or lines with no newline character.
SunOS 5.10 5 Jul 1990 fmlcut(1F)