I've been reading about, and testing printf options for a while now, and am stuck on how to handle the above situation where one of the fields in a column is blank-whitespace. I tried using printf in the above code, specifically the following line using the first six fields only (i want to format the rest of the fields too, but for testing purposes only tried the first six to show my problem):
Which messes up which columns go where. So, how can i handle formatting a field that is whitespace?
I have a set of files of multi-line records with the records separated by a blank line. I needed to add a record number to the front of each line followed by a colon and did the following:
awk 'BEGIN {FS = "\n"; RS = ""}{for (i=1; i<=NF; i++)print NR,":",$i}' ~/Desktop/data98-1-25.txt >... (3 Replies)
Hi Sorry to multipost. I am opening the new thread because the earlier threads head was misleading to my current doubt.
and i am stuck.
list=`cat /u/Test/programs`;
psg "ServTest" | awk -v listawk=$list '{
cmd_name=($5 ~ /^/)? $9:$8
for(pgmname in listawk)
... (6 Replies)
I have a file has following records
policy glb id 1233 name Permit ping from "One" to "Second" "Address1" "Any" "ICMP-ANY" permit
policy id 999251
service "snmp-udp"
exit
policy glb id 1234 name Permit telnet from "One" to "Second" "Address2" "Any" "TCP-ANY" permit
policy id 1234... (3 Replies)
Some records in a file look like this, with any number of lines between start and end flags:
/Start
Some stuff
Banana 1
Some more stuff
End/
/Start
Some stuff
End/
/Start
Some stuff
Some more stuff
Banana 2
End/
...how would I process this file to find records containing the... (8 Replies)
Hi all,
I So, I've got a monster text document comprising a list of various company names and associated info just in a long list one after another. I need to sort them alphabetically by name...
The text document looks like this:
Company Name:
the_first_company's_name_here
Address:... (2 Replies)
Now that I've parsed out the data that I desire I'm left with variable length multi-line records that are field seperated by new lines (\n) and record seperated by a single empty line ("")
At first I was considering doing something like this to append all of the record rows into a single row:
... (4 Replies)
I have a file with data records separated by multiple equals signs, as below.
==========
RECORD 1
==========
RECORD 2
DATA LINE
==========
RECORD 3
==========
RECORD 4
DATA LINE
==========
RECORD 5
DATA LINE
==========
I need to filter out all data from this file where the... (2 Replies)
Hey, not too good at this, so I only managed a clumsy and SLOW solution to my problem that needs a drastic speed up. Any ideas how I write the following in awk only?
Code is supposed to do...
For every line read column values $6, $7, $8 and do a calculation with the same column values of every... (6 Replies)
Greetings Experts,
As part of automating the sql generation, I have the source table name, target table name, join condition stored in a file join_conditions.txt which is a delimited file (I can edit the file if for any reason). The reason I needed to store is I have built SELECT list without... (5 Replies)
iso2022jp(5) File Formats Manual iso2022jp(5)NAME
iso2022jp, iso-2022-jp, ISO-2022-JP - A character encoding system (codeset) for Japanese
DESCRIPTION
The ISO-2022-JP codeset consists of the following character sets: ASCII
For information on the ASCII character set, refer to ascii(5). JIS X0201-1976
Only the Roman letters in this character set are included. For details, refer to deckanji(5). JIS X0208-1978 JIS X0208-1983
JIS X0208-1983 is a revised version of JIS X0208-1978 and remapped some characters of JIS X0208-1978 to other positions.
Before a character is used, its corresponding character set must be designated. In ISO-2022-JP, the designation of a character set is done
by using an escape sequence as follows:
---------------------------------------------------------------
Escape Sequence Character Set
---------------------------------------------------------------
ESC ( B ACSII
ESC ( J JIS X0201-1976 (left-hand part)
ESC $ @ JIS X0208-1978
ESC $ ( 0 User-defined characters (This range of char-
acters is proprietary to Compaq.)
ESC $ B JIS X0208-1983
---------------------------------------------------------------
It is assumed that the starting code of a line is ASCII (including CR alone and LF alone, but not including the combination CRLF). If there
are JIS X0208 characters on a line, there must be a switch to ASCII or to the left-hand part of JIS X0201 (Roman letters) before the end of
the line (in other words, before the CRLF, or carriage return and line feed).
For example, if a line starts with the ASCII character 9, followed by the JIS X0208-1978 character at row 16 column 1, the line is encoded
as follows:
39h ESC $ @ 30h 21h .... ESC ( B .... CRLF
If a line starts with the JIS X0208-1978 character at row 16 column 1, followed by the ASCII character 9, then the line is encoded as fol-
lows:
ESC $ @ 30h 21h ESC ( B 39h .... CRLF
Once a character set is designated, there is no need to redesignate the character set if the adjacent character belongs to the same charac-
ter set. For example, the following practice is not recommended:
ESC $ B .... ESC $ B ....
Currently, the operating system supports the ISO 2022-JP codeset only through codeset converters; there is no direct support through
locales or fonts. For your options in printing and displaying Japanese characters, refer to i18n_printing(5) and Japanese(5).
Codeset Conversion
The following codeset converter pairs are available for converting Japanese characters between ISO-2022-JP and other encoding formats. In
converter names, the string ISO-2022-JP indicates that user-defined characters are not included in the conversion jwhile the string
ISO-2022-JPext indicates that user-defined characters are included in the convertsion. Refer to iconv_intro(5) for an introduction to code-
set conversion. For more information about the other codeset for which ISO-2022-JP or ISO-2022-JPext is the input or output, see the refer-
ence page specified in the list item. deckanji_ISO-2022-JP or deckanji_ISO-2022-JPext, ISO-2022-JP_deckanji or ISO-2022-JPext_deckanji
Converting from and to the DEC Kanji codeset: deckanji(5). eucJP_ISO-2022-JP or eucJP_ISO-2022-JPext, ISO-2022-JP_eucJP or
ISO-2022-JPext_eucJP
Converting from and to Japanese Extended UNIX Code: eucJP(5). sdeckanji_ISO-2022-JP or sdeckanji_ISO-2022-JPext, ISO-2022-JP_sdeck-
anji or ISO-2022-JPext_sdeckanji
Converting from and to the Super DEC Kanji codeset: sdeckanji(5). SJIS_ISO-2022-JP or SJIS_ISO-2022-JPext, ISO-2022-JP_SJIS or
ISO-2022-JPext_SJIS
Converting from and to the Shift JIS codeset: SJIS(5).
Note that SJIS encoding is equivalent to the Microsoft code-page format used on PC systems. Therefore, you can use these converters
to convert Japanese characters between the ISO 2022-JP and PC code-page formats. See code_page(5) for information on how the operat-
ing system supports PC code pages.
SEE ALSO
Commands: locale(1)
Others: ascii(5), code_page(5), deckanji(5), eucJP(5), i18n_intro(5), i18n_printing(5), iconv_intro(5), iso2022(5), Japanese(5),
jiskanji(5), l10n_intro(5), sdeckanji(5), shiftjis(5)iso2022jp(5)