Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

A mathematician is a device for turning coffee into theorems. -- P. Erdos


devel / comp.lang.awk / Serial numbers as RS

SubjectAuthor
o Serial numbers as RSraj

1
Serial numbers as RS

<f8de928c-9e01-4c9c-9562-6b7db6206b38n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1352&group=comp.lang.awk#1352

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:622a:1a11:b0:3b6:36cb:51f8 with SMTP id f17-20020a05622a1a1100b003b636cb51f8mr285420qtb.498.1674013041779;
Tue, 17 Jan 2023 19:37:21 -0800 (PST)
X-Received: by 2002:a05:6808:16a6:b0:364:e50e:337c with SMTP id
bb38-20020a05680816a600b00364e50e337cmr300598oib.34.1674013041412; Tue, 17
Jan 2023 19:37:21 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Tue, 17 Jan 2023 19:37:21 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=183.83.134.74; posting-account=QvOHZQoAAACPAWJegNxpRnFc_Xh1y_DR
NNTP-Posting-Host: 183.83.134.74
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f8de928c-9e01-4c9c-9562-6b7db6206b38n@googlegroups.com>
Subject: Serial numbers as RS
From: visitnag@gmail.com (raj)
Injection-Date: Wed, 18 Jan 2023 03:37:21 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2532
 by: raj - Wed, 18 Jan 2023 03:37 UTC

Hi
I have file with 7 fields.
The first field is serial number
In some records 5th field is missing.
Few records got truncated with the next record. In the sample file
I have shown only two records truncation but in some cases even three to four records got truncated.
sample file:

1 651 643786485 107249 5190 M SMITH 1284
2 963 212018826 103480 M746 R WADHWA 156
3 232 215036022 105012 M743 SAMBA 337
4 232 215036023 105012 M743 SAMBA 443
5 054 215036704 103325 KIYA K 351 ====> 5th field is missing
6 205 308363068 103402 5537 Mc DON 943
7 231 343328800 105880 MANO M 6403 8 231 343329128 105880 MANO M 8324 =====> in both the records 5th field is missing
9 309 361257222 103595 M564 C R SAM 102 10 309 361297561 103595 M564 C R SAM 332
11 216 308659868 625402 9693 FERNAND 365

The required output:

1 651 643786485 107249 5190 M SMITH 1284
2 963 212018826 103480 M746 R WADHWA 156
3 232 215036022 105012 M743 SAMBA 337
4 232 215036023 105012 M743 SAMBA 443
5 054 215036704 103325 4897 KIYA K 351
6 205 308363068 103402 5537 Mc DON 943
7 231 343328800 105880 MANO M 6403
8 231 343329128 105880 MANO M 8324
9 309 361257222 103595 M564 C R SAM 102
10 309 361297561 103595 M564 C R SAM 332
11 216 308659868 625402 9693 FERNAND 365

I have tried by considering the serial number as RS but did not get the desired result

awk 'BEGIN{RS="[0-9]+"}{
print $0 RT
}' file

Actually I need first four fields(including serial number) and the last field.
If the "," delimiter is given in the output that would be more helpful.

Thank you

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor