Explore all Energy and Utilities related open source software, libraries, packages, source code, cloud functions and APIs.

Organizations that maintain the infrastructure for a public service across coal, electricity, natural gas, renweables, water, sewage, telephone, internet and transportation.

These software components cover functions across Distribution, Environmental Impact, Generation, Green Power, Metering, Transmission areas.

Popular New Releases in Energy and Utilities

oshi

Release 6.1.6

http-kit

v2.5.3 (2021 Feb 21)

TensorFlowTTS

TensorFlowTTS v1.8

pslab-android

PSLab Version 2.1.0

ysoserial.net

Release 1.34

Popular Libraries in Energy and Utilities

autosub

by agermanidis doticonpythondoticon

star image 3289 doticonMIT

[NO LONGER MAINTAINED] Command-line utility for auto-generating subtitles for any video file

oshi

by oshi doticonjavadoticon

star image 3112 doticonMIT

Native Operating System and Hardware Information

ALAE

by podgorskiy doticonpythondoticon

star image 3096 doticon

[CVPR2020] Adversarial Latent Autoencoders

http-kit

by http-kit doticonjavadoticon

star image 2194 doticonApache-2.0

http-kit is a minimalist, event-driven, high-performance Clojure HTTP server/client library with WebSocket and asynchronous support

glad

by Dav1dde doticonpythondoticon

star image 2177 doticonNOASSERTION

Multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs.

TensorFlowTTS

by TensorSpeech doticonpythondoticon

star image 2140 doticonApache-2.0

:stuck_out_tongue_closed_eyes: TensorFlowTTS: Real-Time State-of-the-art Speech Synthesis for Tensorflow 2 (supported including English, French, Korean, Chinese, German and Easy to adapt for other languages)

yandex-tank

by yandex doticonpythondoticon

star image 2120 doticonLGPL-2.1

Load and performance benchmark tool

vuegg

by vuegg doticonjavascriptdoticon

star image 2078 doticonMIT

:hatching_chick: vue GUI generator

pslab-android

by fossasia doticonjavadoticon

star image 1990 doticonApache-2.0

PSLab Android App https://play.google.com/store/apps/details?id=io.pslab

Trending New libraries in Energy and Utilities

TensorFlowTTS

by TensorSpeech doticonpythondoticon

star image 2140 doticonApache-2.0

:stuck_out_tongue_closed_eyes: TensorFlowTTS: Real-Time State-of-the-art Speech Synthesis for Tensorflow 2 (supported including English, French, Korean, Chinese, German and Easy to adapt for other languages)

goindex-theme-acrou

by Achrou doticonjavascriptdoticon

star image 1622 doticonMIT

This is a goindex theme.一个goindex的扩展主题。

vite-electron-builder

by cawa-93 doticontypescriptdoticon

star image 953 doticonMIT

Secure boilerplate for Electron app based on Vite. TypeScript + Vue/React/Angular/Svelte/Vanilla

co2-data

by owid doticonpythondoticon

star image 259 doticon

Data on CO2 and greenhouse gas emissions by Our World in Data

MichiGAN

by tzt101 doticonpythondoticon

star image 173 doticonMIT

MichiGAN: Multi-Input-Conditioned Hair Image Generation for Portrait Editing (SIGGRAPH 2020)

az-iranian-bank-gateways

by ali-zahedi doticonpythondoticon

star image 158 doticonMIT

درگاه اتصال به بانک های ایرانی ( درگاه پرداخت بانک ملی ایران،بانک سامان، بانک ملت، درگاه پرداخت زرین پال و ... ) با استفاده از پایتون

svelte-capacitor

by drannex42 doticonhtmldoticon

star image 135 doticon

Build hybrid mobile apps using Svelte and CapacitorJS with live reloading on Android and iOS!

electron-vue-next

by ci010 doticonjavascriptdoticon

star image 131 doticon

A starter template for using vue-next with the electron.

antares

by microsoft doticonc++doticon

star image 130 doticonNOASSERTION

Antares: an automatic engine for multi-platform kernel generation and optimization. Supporting CPU, CUDA, ROCm, DirectX12, GraphCore, SYCL for CPU/GPU, OpenCL for AMD/NVIDIA, Android CPU/GPU backends.

Top Authors in Energy and Utilities

1

LambdaTest

9 Libraries

star icon47

2

NREL

4 Libraries

star icon100

3

FZJ-IEK3-VSA

4 Libraries

star icon54

4

thegreenwebfoundation

3 Libraries

star icon56

5

microsoft

3 Libraries

star icon207

6

rse

3 Libraries

star icon58

7

fossasia

3 Libraries

star icon5368

8

googlearchive

2 Libraries

star icon68

9

github-modules

2 Libraries

star icon29

10

chennnnnyize

2 Libraries

star icon28

1

9 Libraries

star icon47

2

4 Libraries

star icon100

3

4 Libraries

star icon54

4

3 Libraries

star icon56

5

3 Libraries

star icon207

6

3 Libraries

star icon58

7

3 Libraries

star icon5368

8

2 Libraries

star icon68

9

2 Libraries

star icon29

10

2 Libraries

star icon28

Trending Kits in Energy and Utilities

Energy Analytics Solution is a platform that enables users to analyze their energy consumption data. Using Energy Analytics Solution, organizations can track the usage of various types of energy and resources in real time, which helps them save energy costs, improve efficiency, and understand their carbon footprint. Organizations use Energy Analytics Solution to access aggregated data from multiple sources such as utility bills, building management systems (BMS), and equipment sensors. They can then combine this information with additional data sets such as weather forecasts or employee schedules to generate detailed analytics reports about their energy usage patterns. kandi kit provides you with a fully deployable Energy Analytics Solution. Source code included so that you can customize it for your requirement.

OLAP data visualization

OLAP data visualization libraries can be used to drill down, roll up or slice and dice the data from OLAP databases.

Exploratory Data Analysis

The data exploration helps in doing extensive analysis of different data types and in assisting to understand the patterns. Data visualisation helps in representing the insights graphically. Libraries in this section are used for analysis and visualisation of data.

Data Labeling Libraries

Libraries in this section are used for annotating data for creating training data for machine learning.

Mobile

Trending Discussions on Energy and Utilities

How to compare timeStamp whe i can't seem to bring them to a common format using GAS?

How to make all common functions centralised in AWS Lambda Function (Python)?

Angular - Bootstrap 5 "utilities" not compiled

Set default extension webpage name in Bootstudio

Convert CSV charset from Shift-JIS to UTF-8

new Date() vs. Utilities.formatDate(new Date())

Add new utilities with Bootstrap 5

Using ls -lR ignore given REGEX

QUESTION

How to compare timeStamp whe i can't seem to bring them to a common format using GAS?

Asked 2022-Feb-18 at 17:17

So, on form submit, I got a timestamp, which looks like this: "values":["2/18/2022 14:11:25"]

I then need to compare it with the one on the spreadsheet, so that I can set a number to an adjacent column. Then, I'm using the code below, but I'm facing an error on ```Utilities.formatDate()````

The code:

1function onSubmit(e) {
2  Logger.log("%s", JSON.stringify(e));
3  const timeStamp = e.values[0]
4  const formRespSheet = e.source.getSheetByName('Form Responses 1')
5  var maxNumber = Math.max.apply(null, formRespSheet.getRange(2, 14, formRespSheet.getLastRow(), 1).getValues());
6  maxNumber = maxNumber + 1
7
8  Utilities.sleep(1000);//Tried it
9  const allTimeStamps = formRespSheet.getRange(2, 1, formRespSheet.getLastRow(), 1).getValues();
10
11  for (let a = 0; a < allTimeStamps.length; a++) {
12    let sheetTimeStamp = allTimeStamps[a]
13    sheetTimeStamp = Utilities.formatDate(sheetTimeStamp, Session.getTimeZone(), "MM/dd/yyyy HH:mm:ss")
14    if (sheetTimeStamp.valueOf() == timeStamp.valueOf()) {
15      const row = a + 1
16      formRespSheet.getRange(row, 14).setValue(maxNumber)
17    }
18  }
19}
20

The error says:

1function onSubmit(e) {
2  Logger.log("%s", JSON.stringify(e));
3  const timeStamp = e.values[0]
4  const formRespSheet = e.source.getSheetByName('Form Responses 1')
5  var maxNumber = Math.max.apply(null, formRespSheet.getRange(2, 14, formRespSheet.getLastRow(), 1).getValues());
6  maxNumber = maxNumber + 1
7
8  Utilities.sleep(1000);//Tried it
9  const allTimeStamps = formRespSheet.getRange(2, 1, formRespSheet.getLastRow(), 1).getValues();
10
11  for (let a = 0; a < allTimeStamps.length; a++) {
12    let sheetTimeStamp = allTimeStamps[a]
13    sheetTimeStamp = Utilities.formatDate(sheetTimeStamp, Session.getTimeZone(), "MM/dd/yyyy HH:mm:ss")
14    if (sheetTimeStamp.valueOf() == timeStamp.valueOf()) {
15      const row = a + 1
16      formRespSheet.getRange(row, 14).setValue(maxNumber)
17    }
18  }
19}
20The parameters (number[],String,String) don't match the method signature for Utilities.formatDate.
21

Thanks for your help.

ANSWER

Answered 2022-Feb-18 at 14:39
1function onSubmit(e) {
2  Logger.log("%s", JSON.stringify(e));
3  const timeStamp = e.values[0]
4  const formRespSheet = e.source.getSheetByName('Form Responses 1')
5  var maxNumber = Math.max.apply(null, formRespSheet.getRange(2, 14, formRespSheet.getLastRow(), 1).getValues());
6  maxNumber = maxNumber + 1
7
8  Utilities.sleep(1000);//Tried it
9  const allTimeStamps = formRespSheet.getRange(2, 1, formRespSheet.getLastRow(), 1).getValues();
10
11  for (let a = 0; a < allTimeStamps.length; a++) {
12    let sheetTimeStamp = allTimeStamps[a]
13    sheetTimeStamp = Utilities.formatDate(sheetTimeStamp, Session.getTimeZone(), "MM/dd/yyyy HH:mm:ss")
14    if (sheetTimeStamp.valueOf() == timeStamp.valueOf()) {
15      const row = a + 1
16      formRespSheet.getRange(row, 14).setValue(maxNumber)
17    }
18  }
19}
20The parameters (number[],String,String) don't match the method signature for Utilities.formatDate.
21sheetTimeStamp = Utilities.formatDate(sheetTimeStamp, Session.getTimeZone(), "MM/dd/yyyy HH:mm:ss")
22

change into:

1function onSubmit(e) {
2  Logger.log("%s", JSON.stringify(e));
3  const timeStamp = e.values[0]
4  const formRespSheet = e.source.getSheetByName('Form Responses 1')
5  var maxNumber = Math.max.apply(null, formRespSheet.getRange(2, 14, formRespSheet.getLastRow(), 1).getValues());
6  maxNumber = maxNumber + 1
7
8  Utilities.sleep(1000);//Tried it
9  const allTimeStamps = formRespSheet.getRange(2, 1, formRespSheet.getLastRow(), 1).getValues();
10
11  for (let a = 0; a < allTimeStamps.length; a++) {
12    let sheetTimeStamp = allTimeStamps[a]
13    sheetTimeStamp = Utilities.formatDate(sheetTimeStamp, Session.getTimeZone(), "MM/dd/yyyy HH:mm:ss")
14    if (sheetTimeStamp.valueOf() == timeStamp.valueOf()) {
15      const row = a + 1
16      formRespSheet.getRange(row, 14).setValue(maxNumber)
17    }
18  }
19}
20The parameters (number[],String,String) don't match the method signature for Utilities.formatDate.
21sheetTimeStamp = Utilities.formatDate(sheetTimeStamp, Session.getTimeZone(), "MM/dd/yyyy HH:mm:ss")
22sheetTimeStamp = Utilities.formatDate(new Date(sheetTimeStamp), Session.getTimeZone(), "MM/dd/yyyy HH:mm:ss")
23

it should work

Source https://stackoverflow.com/questions/71174929

QUESTION

How to make all common functions centralised in AWS Lambda Function (Python)?

Asked 2021-Nov-19 at 13:11

I have one use case where I have created ~40 Lambda Function (Python3.8). All these functions use 5 to 6 common custom functions or utilities that are available within the python code.

I wanted to know that is it possible to manage all these common static functions in a separate class and centralise it that will be used by all functions?

This will help me to make any changes in the common functions and auto replicate these changes to all functions rather than doing it in each function manually.

I know we can use custom class and import as a new Python file (along with lambda_handler) with deployment packages and import in code but this will again create overhead to make changes or replace each attached python file.

Please suggest the best way to manage it.

Please note, I am not using any CICD.

ANSWER

Answered 2021-Nov-19 at 13:11

You can put your common code in a layer and then assign that layer to the Lambdas that use the common code. See Lambda Layers

Source https://stackoverflow.com/questions/70035130

QUESTION

Angular - Bootstrap 5 "utilities" not compiled

Asked 2021-Jun-29 at 22:07

I've upgraded my angular app to use the bootstrap 5 styles. Since bootstrap 5 removed many utilities like cursor-pointer, I now have to define the utilities I want to use myself. I've tried to use the api as described in the docs, but without success. The so called utilities I write never end up in the resulting css file.

In the styles.scss I have written the following utility according to the docs:

1/* You can add global styles to this file, and also import other style files */
2@import "bootstrap/scss/functions";
3@import "bootstrap/scss/variables";
4@import "bootstrap/scss/utilities";
5
6$utilities: map-merge(
7    $utilities,
8    (
9        "cursor": (
10            property: cursor,
11            class: cursor,
12            // responsive: true,
13            // values: auto pointer grab
14            values: (
15                pointer: pointer,
16                grab: grab
17            )
18        )
19    )
20);
21

So this should be compiled to style rules like .cursor-pointer { cursor: pointer } and .cursor-grab { cursor: grab }. But when I look in the resulting styles.css, the rules I defined are nowhere to be found.

I've published a repository here.

What am I missing here?

ANSWER

Answered 2021-Jun-29 at 22:07
Solution

https://stackblitz.com/edit/angular-ivy-mzexcm?file=src%2Fstyles.scss

  • Instead of importing the bootstrap.scss through angular.json, import it from styles.scss:

angular.json

1/* You can add global styles to this file, and also import other style files */
2@import "bootstrap/scss/functions";
3@import "bootstrap/scss/variables";
4@import "bootstrap/scss/utilities";
5
6$utilities: map-merge(
7    $utilities,
8    (
9        "cursor": (
10            property: cursor,
11            class: cursor,
12            // responsive: true,
13            // values: auto pointer grab
14            values: (
15                pointer: pointer,
16                grab: grab
17            )
18        )
19    )
20);
21{
22  ...,
23  "projects": {
24    "ng-draggable-listview-demo": {
25      ...,
26      "architect": {
27        "build": {
28          ...,
29          "options": {
30            ...,
31            "styles": [
32              //"node_modules/bootstrap/scss/bootstrap.scss",
33              "projects/ng-draggable-listview-demo/src/styles.scss"
34            ]
35          }
36        },
37        ...
38      }
39    }
40  }
41}
42

src/styles.scss

1/* You can add global styles to this file, and also import other style files */
2@import "bootstrap/scss/functions";
3@import "bootstrap/scss/variables";
4@import "bootstrap/scss/utilities";
5
6$utilities: map-merge(
7    $utilities,
8    (
9        "cursor": (
10            property: cursor,
11            class: cursor,
12            // responsive: true,
13            // values: auto pointer grab
14            values: (
15                pointer: pointer,
16                grab: grab
17            )
18        )
19    )
20);
21{
22  ...,
23  "projects": {
24    "ng-draggable-listview-demo": {
25      ...,
26      "architect": {
27        "build": {
28          ...,
29          "options": {
30            ...,
31            "styles": [
32              //"node_modules/bootstrap/scss/bootstrap.scss",
33              "projects/ng-draggable-listview-demo/src/styles.scss"
34            ]
35          }
36        },
37        ...
38      }
39    }
40  }
41}
42$utilities: () !default;
43
44$utilities: map-merge(
45    $utilities,
46    (
47        "cursor": (
48            property: cursor,
49            class: cursor,
50            values: (
51                pointer: pointer,
52                grab: grab
53            )
54        )
55    )
56);
57
58@import '~bootstrap/scss/bootstrap.scss';
59

Now you can use both the bootstrap utilities (eg. float-end) and your own utilities (eg. cursor-grab):

1/* You can add global styles to this file, and also import other style files */
2@import "bootstrap/scss/functions";
3@import "bootstrap/scss/variables";
4@import "bootstrap/scss/utilities";
5
6$utilities: map-merge(
7    $utilities,
8    (
9        "cursor": (
10            property: cursor,
11            class: cursor,
12            // responsive: true,
13            // values: auto pointer grab
14            values: (
15                pointer: pointer,
16                grab: grab
17            )
18        )
19    )
20);
21{
22  ...,
23  "projects": {
24    "ng-draggable-listview-demo": {
25      ...,
26      "architect": {
27        "build": {
28          ...,
29          "options": {
30            ...,
31            "styles": [
32              //"node_modules/bootstrap/scss/bootstrap.scss",
33              "projects/ng-draggable-listview-demo/src/styles.scss"
34            ]
35          }
36        },
37        ...
38      }
39    }
40  }
41}
42$utilities: () !default;
43
44$utilities: map-merge(
45    $utilities,
46    (
47        "cursor": (
48            property: cursor,
49            class: cursor,
50            values: (
51                pointer: pointer,
52                grab: grab
53            )
54        )
55    )
56);
57
58@import '~bootstrap/scss/bootstrap.scss';
59<body>
60  <ul class="list-group cursor-grab">
61    <li class="list-group-item" *ngFor="let item of items">
62      <span class="float-end">{{ item }}</span>
63    </li>
64  </ul>
65</body>
66

Source https://stackoverflow.com/questions/68185210

QUESTION

Set default extension webpage name in Bootstudio

Asked 2021-Apr-06 at 12:35

I'm using BootstrapStudio for create some pages for my site. I usually use htm as extension for web pages instead of html, so I wonder if there is anyway to change the defautl html extension in BootstrapStudio. Thanks

ANSWER

Answered 2021-Apr-06 at 12:35

I don't think this is possible in Bootstrap Studio but you can write a script to run when you export your site to change all the file extensions.

Try taking a look at https://bootstrapstudio.io/tutorials/export-scripts

If you are running Bootstrap Studio on linux the script would look something like:

1#!/bin/bash
2cd "$1"
3for f in *.html; do mv -- "$f" "${f%.html}.htm"; done
4

Source https://stackoverflow.com/questions/66747032

QUESTION

Convert CSV charset from Shift-JIS to UTF-8

Asked 2021-Feb-27 at 23:50
What I want to do
  1. Fetch data from a CSV file (charset: Shift-JIS)
  2. Convert the charset to UTF-8
  3. Set the values into Google Spread Sheets

I have a problem on step 2.

Issue

I'm having a trouble converting Shift-JIS CSV to UTF-8 CSV.
The strings in Google Spread Sheets are all garbled.

Here is my code and screenshots of Google Spread Sheets:

1function myFunction() {
2  const fileId = 'xxxxxx' // Shift-JIS CSV file's ID
3  const blob = DriveApp.getFileById(fileId).getBlob();
4  const csv = blob.getDataAsString();
5
6  const newBlob = Utilities.newBlob('', MimeType.CSV).setDataFromString(csv, 'UTF-8');
7  const newCSV = newBlob.getDataAsString();
8
9  const values = Utilities.parseCsv(newCSV);
10
11  const sheet = SpreadsheetApp.getActiveSheet();
12  sheet.getRange(1, 1, values.length, values[0].length).setValues(values);
13}
14

Expected: Ideal

Instead of: Actual

ANSWER

Answered 2021-Feb-27 at 23:50

I think that in your script, it is required to retrieve the values from the file (CSV data of shift-jis) as shift-jis. In this case, const newBlob = Utilities.newBlob('', MimeType.CSV).setDataFromString(csv, 'UTF-8'); is not required to be used. So when your script is modified, it becomes as follows.

Modified script:
1function myFunction() {
2  const fileId = 'xxxxxx' // Shift-JIS CSV file's ID
3  const blob = DriveApp.getFileById(fileId).getBlob();
4  const csv = blob.getDataAsString();
5
6  const newBlob = Utilities.newBlob('', MimeType.CSV).setDataFromString(csv, 'UTF-8');
7  const newCSV = newBlob.getDataAsString();
8
9  const values = Utilities.parseCsv(newCSV);
10
11  const sheet = SpreadsheetApp.getActiveSheet();
12  sheet.getRange(1, 1, values.length, values[0].length).setValues(values);
13}
14function myFunction() {
15  const fileId = 'xxxxxx' // Shift-JIS CSV file's ID
16  const blob = DriveApp.getFileById(fileId).getBlob();
17
18  const csv = blob.getDataAsString("shift-jis");  // Modified
19
20  const values = Utilities.parseCsv(csv);
21  const sheet = SpreadsheetApp.getActiveSheet();
22  sheet.getRange(1, 1, values.length, values[0].length).setValues(values);
23}
24

Source https://stackoverflow.com/questions/66402580

QUESTION

new Date() vs. Utilities.formatDate(new Date())

Asked 2021-Jan-02 at 19:19

Can anyone tell me why this code would produce two different dates?

1let now = new Date();  // today's date (1/2/2021)
2Logger.log(now);       // Sat Jan 02 09:42:47 GMT-08:00 2021
3Logger.log(new Date(now.getTime()-(2*1000*60*60*24)));   // Thu Dec 31 09:42:47 GMT-08:00 2020
4Logger.log(Utilities.formatDate(new Date(now.getTime()-(2*1000*60*60*24)), "GMT-8", "MM/d/YYYY"));  // 12/31/2021
5

Why would Utilities.formateDate() change the date from 12/31/2020 to 12/31/2021?

******** SOLUTION *********

Change the date format from "MM/d/YYYY" to "MM/d/yyyy".

ANSWER

Answered 2021-Jan-02 at 18:20

It's just a simple formatting problem. Look here

This: Logger.log(Utilities.formatDate(new Date(now.getTime()-(2*1000*60*60*24)), "GMT-8", "MM/d/YYYY"));

Should be this:

Logger.log(Utilities.formatDate(new Date(now.getTime()-(2*1000*60*60*24)), "GMT-8", "MM/d/yyyy"));

In other words just make the capital Y's lower case y's and you're there.

Source https://stackoverflow.com/questions/65542330

QUESTION

Add new utilities with Bootstrap 5

Asked 2020-Dec-21 at 02:13

Following the B5 new documentation, this is how you are supposed to add new utilities with the new utilities API. I have not been the get the new output though.

exemple:

1@import "bootstrap/scss/utilities";
2
3$utilities: map-merge(
4  $utilities,
5  (
6    "cursor": (
7      property: cursor,
8      class: cursor
9      responsive: true,
10      values: auto pointer grab,
11    )
12  )
13);
14

my file:

1@import "bootstrap/scss/utilities";
2
3$utilities: map-merge(
4  $utilities,
5  (
6    "cursor": (
7      property: cursor,
8      class: cursor
9      responsive: true,
10      values: auto pointer grab,
11    )
12  )
13);
14@import "bootstrap.scss";
15@import "bootstrap/scss/utilities";
16
17$utilities: map-merge(
18  $utilities,
19  (
20    "button-rounded": (
21      property: border-radius,
22      class: button-rounded,
23      values: (
24        null: 20px,
25      ),
26    ),
27  )
28);
29
  • I need to import bootstrap.scss because $utilities is undefined otherwise
  • the goal is to add a new property to make the button rounded.simple example to test out the new API. not working though
  • I am using the https://github.com/twbs/bootstrap-npm-starter to compile the scss files: the src is starter.scss and the output is starter.css

I cannot find the new property button-rounded

ANSWER

Answered 2020-Dec-21 at 02:13

When making any SASS customizations, the @import "bootstrap" should go after the changes. Also, the utilities file requires the variables file, and the variables file requires the functions file, so you must import all 3 before the change...

1@import "bootstrap/scss/utilities";
2
3$utilities: map-merge(
4  $utilities,
5  (
6    "cursor": (
7      property: cursor,
8      class: cursor
9      responsive: true,
10      values: auto pointer grab,
11    )
12  )
13);
14@import "bootstrap.scss";
15@import "bootstrap/scss/utilities";
16
17$utilities: map-merge(
18  $utilities,
19  (
20    "button-rounded": (
21      property: border-radius,
22      class: button-rounded,
23      values: (
24        null: 20px,
25      ),
26    ),
27  )
28);
29@import "bootstrap/scss/functions";
30@import "bootstrap/scss/variables";
31@import "bootstrap/scss/utilities";
32
33$utilities: map-merge(
34  $utilities,
35  (
36    "button-rounded": (
37      property: border-radius,
38      class: button-rounded,
39      values: (
40        null: 20px,
41      ),
42    ),
43  )
44);
45
46@import "bootstrap";
47

Demo

Since Bootstrap 5 is currently beta, I've submitted an issue report for this.

Source https://stackoverflow.com/questions/65376233

QUESTION

Using ls -lR ignore given REGEX

Asked 2020-Mar-16 at 09:26

I’m using ls -lR | ... to get my desired output, but now I need something that would force ls to ignore given regex expression. Is it possible to achieve this? I found ls -I and ls --ignore but for some reason I get: illegal option error [macOS Catalina 10.15.3]. I need this to be working on most frequently used shells(bash, ksh, zsh etc..)

Output

1ls -lR | ...
2
3./NOEMPTY:
4total 72
5-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 10.c
6-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 15.c
7-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 20.c
8-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 25.c
9-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
10-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
11-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 40.c
12-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 5.c
13-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b.c
14
15./NOT_THIS:
16total 32
17-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30 2.c
18-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
19-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35 2.c
20-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
21
22./THIS_YES:
23total 32
24-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30 2.c
25-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
26-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35 2.c
27-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
28

Desired Output:

1ls -lR | ...
2
3./NOEMPTY:
4total 72
5-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 10.c
6-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 15.c
7-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 20.c
8-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 25.c
9-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
10-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
11-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 40.c
12-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 5.c
13-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b.c
14
15./NOT_THIS:
16total 32
17-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30 2.c
18-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
19-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35 2.c
20-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
21
22./THIS_YES:
23total 32
24-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30 2.c
25-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
26-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35 2.c
27-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
28ls -lR IGNORE NOT_THIS | ... something more
29./NOEMPTY:
30total 72
31-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 10.c
32-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 15.c
33-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 20.c
34-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 25.c
35-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
36-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
37-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 40.c
38-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 5.c
39-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b.c
40
41./THIS_YES:
42total 32
43-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30 2.c
44-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
45-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35 2.c
46-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
47

I’ve tried to use sed utility but failed to achieve this, since I wasn’t able to select empty line between folders such as this: ls -lR | sed -n '/.\/NOT_THIS/,/[[:space:]]/p'

ANSWER

Answered 2020-Mar-16 at 09:26

Try this : ls -lR -I '*NOT_THIS*'

Demo :

1ls -lR | ...
2
3./NOEMPTY:
4total 72
5-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 10.c
6-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 15.c
7-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 20.c
8-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 25.c
9-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
10-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
11-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 40.c
12-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 5.c
13-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b.c
14
15./NOT_THIS:
16total 32
17-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30 2.c
18-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
19-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35 2.c
20-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
21
22./THIS_YES:
23total 32
24-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30 2.c
25-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
26-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35 2.c
27-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
28ls -lR IGNORE NOT_THIS | ... something more
29./NOEMPTY:
30total 72
31-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 10.c
32-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 15.c
33-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 20.c
34-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 25.c
35-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
36-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
37-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 40.c
38-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 5.c
39-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b.c
40
41./THIS_YES:
42total 32
43-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30 2.c
44-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
45-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35 2.c
46-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
47:=>ls -1
481.txt
492.txt
50a.csv
51b.csv
52:=>ls -1 -I '*txt'
53a.csv
54b.csv
55:=>
56

Using SED

sed '/\.\/NOT_THIS/, /^$/'d

explanation : sed '/start/,/end/d' <-- this will delete all data between first /<patern>/ and second pattern.

^$ <-- Blank line. ^ -- Start of record. $ -- end of record

Demo:

1ls -lR | ...
2
3./NOEMPTY:
4total 72
5-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 10.c
6-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 15.c
7-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 20.c
8-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 25.c
9-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
10-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
11-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 40.c
12-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 5.c
13-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b.c
14
15./NOT_THIS:
16total 32
17-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30 2.c
18-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
19-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35 2.c
20-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
21
22./THIS_YES:
23total 32
24-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30 2.c
25-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
26-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35 2.c
27-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
28ls -lR IGNORE NOT_THIS | ... something more
29./NOEMPTY:
30total 72
31-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 10.c
32-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 15.c
33-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 20.c
34-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 25.c
35-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
36-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
37-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 40.c
38-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 5.c
39-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b.c
40
41./THIS_YES:
42total 32
43-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30 2.c
44-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
45-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35 2.c
46-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
47:=&gt;ls -1
481.txt
492.txt
50a.csv
51b.csv
52:=&gt;ls -1 -I '*txt'
53a.csv
54b.csv
55:=&gt;
56:=&gt;sed '/\.\/NOT_THIS/, /^$/'d file.txt
57ls -lR | ...
58
59./NOEMPTY:
60total 72
61-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 10.c
62-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 15.c
63-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 20.c
64-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 25.c
65-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
66-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
67-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 40.c
68-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 5.c
69-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b.c
70
71./THIS_YES:
72total 32
73-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30 2.c
74-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 30.c
75-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35 2.c
76-rw-r--r--@ 1 makaveli_10  staff  34 Mar 15 09:26 1b copy 35.c
77:=&gt;
78
79

Source https://stackoverflow.com/questions/60702704

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Energy and Utilities

Tutorials and Learning Resources are not available at this moment for Energy and Utilities

Share this Page

share link

Get latest updates on Energy and Utilities