regex - to match part of a string and type the full string out of a given sentence consisting of charater strings -
The path to the files that I have a file list.txt:
Desktop / 28_dec / script / sign_145 / check / sig4n_120 / mu_30; Desktop / 28_dec / run_1 / run_12 / sign_145 / check / sig4n_120 / mu_30; Desktop / 14_feb / eps_14 / run14 // sign_145 / check / sig4n_120 / mu_30 Desktop / 28_dec_2013 / eps3_1200 / eps_nano_20 / sign_130 / sign_145 / check / sig4n_120 / mu_30
and so on. The pattern is quite random.
- On each row, three things have to be noted in the three columns with the full path;
- 'sig4n_' a string of pre-: sig4n_130
- sign-''
- 'mu _' string, split me know The order is to use where the separator will be '/', and then compare the part of the door. I tried to write the script, but my script is showing errors I have the following in Linux:
z = desktop / 28_feb / eps3_1200 / sign_200 / sig4n_120 / mu_10; Awk '{partition ($ z, arr, "/")} & gt; Detadat
The error "
was showing unexpected token" ( '
".I also tried to write
<(= $ 0, arrival, "/"}} 'list.txt to go through my questionThank you.
Still not clear what you are doing - the code you gave Does not mean.
There is a simple solution to your problem
SED-ek /.* \ (sign _...). * \ (Sig4n _ ... \). * \ (Mu .. ..) * $ / \ 1 \ 2 \ 3 / 'list.txt
output (for your input file) :.
sign_145 sig4n_120 mu_30 sign_145 sig4n_120 mu_30 sign_145 sig4n_120 mu_30 sign_145 sig4n_120 mu_30
this assumes that all three items (
signal
,sig4n
, andmu
) exist and Fixed numbers are formatted with numbers. Perhaps you can understand it from here.
Comments
Post a Comment