Re: printing words without newlines?

Liste des GroupesRevenir à cl awk 
Sujet : Re: printing words without newlines?
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : alt.comp.lang.awk comp.lang.awk
Date : 16. May 2024, 14:55:35
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v2538p$1jmvm$1@dont-email.me>
References : 1 2
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 16.05.2024 15:11, Ed Morton wrote:
On 5/11/2024 11:57 PM, David Chmelik wrote:
I'm learning more AWK basics and wrote function to read file, sort,
print.  I use GNU AWK (gawk) and its sort but printing is harder to get
working than anything... separate lines work, but when I use printf() or
set ORS then use print (for words one line) all awk outputs (on FreeBSD
UNIX 14 and Slackware GNU/Linux 15) is a space (and not even newline
before shell prompt)...
 
[...]
------------------------------------------------------------------------
# print_file_words.awk
# pass filename to function
BEGIN { print_file_words("data.txt"); }
>
# read two-column array from file and sort lines and print
function print_file_words(file) {
# set record separator then use print
# ORS=" "
 
Move the above to a BEGIN section so it is executed once total instead
of once per input line.

A function definition called once from the BEGIN section isn't
called "once per input line".

Janis

 
[...]

Date Sujet#  Auteur
12 May 24 * printing words without newlines?19David Chmelik
12 May 24 +* Re: printing words without newlines?5Bruce Horrocks
12 May 24 i+- Re: printing words without newlines?1Bruce Horrocks
12 May 24 i`* Re: printing words without newlines?3Kenny McCormack
13 May 24 i +- Re: printing words without newlines?1David Chmelik
13 May 24 i `- Re: printing words without newlines?1Kaz Kylheku
13 May 24 +* Re: printing words without newlines?3Kenny McCormack
13 May 24 i`* Re: printing words without newlines?2Kenny McCormack
15 Jul 24 i `- Resurrecting an old thread (Was: printing words without newlines?)1Kenny McCormack
13 May 24 +- Re: printing words without newlines?1Janis Papanagnou
13 May 24 +* Re: printing words without newlines?4Kaz Kylheku
13 May 24 i`* Re: printing words without newlines?3Kenny McCormack
14 May 24 i `* Re: printing words without newlines?2Kaz Kylheku
14 May 24 i  `- Array indices are small integers? (Was: printing words without newlines?)1Kenny McCormack
16 May 24 `* Re: printing words without newlines?5Ed Morton
16 May 24  `* Re: printing words without newlines?4Janis Papanagnou
16 May 24   +* Once upon a time... (Was: printing words without newlines?)2Kenny McCormack
16 May 24   i`- Re: Once upon a time... (Was: printing words without newlines?)1Kenny McCormack
17 May 24   `- Re: printing words without newlines?1Ed Morton

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal