Is there any way to get the info lined up in columns using printf? I've tried a few things but it never seems to come out right; maybe the data is just too funky to get it to line-up?
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)
Encode::JP(3pm) Perl Programmers Reference Guide Encode::JP(3pm)NAME
Encode::JP - Japanese Encodings
SYNOPSIS
use Encode qw/encode decode/;
$euc_jp = encode("euc-jp", $utf8); # loads Encode::JP implicitly
$utf8 = decode("euc-jp", $euc_jp); # ditto
ABSTRACT
This module implements Japanese charset encodings. Encodings supported are as follows.
Canonical Alias Description
--------------------------------------------------------------------
euc-jp /euc.*jp$/i EUC (Extended Unix Character)
/jp.*euc/i
/ujis$/i
shiftjis /shift.*jis$/i Shift JIS (aka MS Kanji)
/sjis$/i
7bit-jis /jis$/i 7bit JIS
iso-2022-jp ISO-2022-JP [RFC1468]
= 7bit JIS with all Halfwidth Kana
converted to Fullwidth
iso-2022-jp-1 ISO-2022-JP-1 [RFC2237]
= ISO-2022-JP with JIS X 0212-1990
support. See below
MacJapanese Shift JIS + Apple vendor mappings
cp932 /windows-31j$/i Code Page 932
= Shift JIS + MS/IBM vendor mappings
jis0201-raw JIS0201, raw format
jis0208-raw JIS0201, raw format
jis0212-raw JIS0201, raw format
--------------------------------------------------------------------
DESCRIPTION
To find out how to use this module in detail, see Encode.
Note on ISO-2022-JP(-1)?
ISO-2022-JP-1 (RFC2237) is a superset of ISO-2022-JP (RFC1468) which adds support for JIS X 0212-1990. That means you can use the same
code to decode to utf8 but not vice versa.
$utf8 = decode('iso-2022-jp-1', $stream);
and
$utf8 = decode('iso-2022-jp', $stream);
yield the same result but
$with_0212 = encode('iso-2022-jp-1', $utf8);
is now different from
$without_0212 = encode('iso-2022-jp', $utf8 );
In the latter case, characters that map to 0212 are first converted to U+3013 (0xA2AE in EUC-JP; a white square also known as 'Tofu' or
'geta mark') then fed to the decoding engine. U+FFFD is not used, in order to preserve text layout as much as possible.
BUGS
The ASCII region (0x00-0x7f) is preserved for all encodings, even though this conflicts with mappings by the Unicode Consortium.
SEE ALSO
Encode
perl v5.12.1 2010-04-26 Encode::JP(3pm)