Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] [OT] awk - sed - grep = tying-myself-up-in-knots
Date: Wed, 10 Feb 2016 17:03:02
Message-Id: 4481001.BY1u1L6QGg@dell_xps
1 I've been struggling to parse/split/substitute some names and numbers using a
2 spreadsheet and think that this task may be easier to achieve using
3 conventional *nix tools. The problem is I wouldn't know where to start.
5 I have a directory with loads of images. Each image file name has a
6 description comprising hyphen-separated words and a part number, also hyphen
7 separated; e.g.:
9 some-description-with-words-012-63099.jpg
11 The number and length of the words change for each file. The part number
12 always has two components separated by a hyphen, but may also change in length
13 and acquire more/fewer digits.
15 I need two outputs:
17 1. the description + " (per M²)", like so:
19 some-description-with-words (per M²)
21 2. the part number, but replacing the hyphen with "/", like so:
23 012/63099
26 I can list the directory contents and redirect all image file names into a txt
27 file. What I am looking for is some additional steps I can pipe it through to
28 obtain the two outputs, either in the same file or different files. These
29 file(s) are then imported into a spreadsheet template and manipulated, before
30 the result is ultimately exported from the spreadsheet and uploaded to a
31 server as a CSV file.
33 Is this parsing, splitting and substitution exercise achievable? Any
34 suggestions to try out?
36 --
37 Regards,
38 Mick


File name MIME type
signature.asc application/pgp-signature


Subject Author
Re: [gentoo-user] [OT] awk - sed - grep = tying-myself-up-in-knots "J. Roeleveld" <joost@××××××××.org>
Re: [gentoo-user] [OT] awk - sed - grep = tying-myself-up-in-knots Nils Freydank <nils.freydank@××××××.de>
Re: [gentoo-user] [OT] awk - sed - grep = tying-myself-up-in-knots Dale <rdalek1967@×××××.com>
Re: [gentoo-user] [OT] awk - sed - grep = tying-myself-up-in-knots Alexander Kapshuk <alexander.kapshuk@×××××.com>
[gentoo-user] Re: [OT] awk - sed - grep = tying-myself-up-in-knots James <wireless@×××××××××××.com>