How to write a script in google app to import from google sheets to google docs with sorting - sorting

Here is a google spreadsheet:
Date (B)
Shift (C)
Workshop (E)
Identified root cause, work done (N)
01.02.2023
Day shift
OSSH
text 1
02.02.2023
Day shift
GK
text 2
03.02.2023
Day shift
OSSH
text 3
04.02.2023
Day shift
OF&FK
text 4
01.02.2023
Night shift
GK
text 5
06.02.2023
Night shift
GK...
text 6
I need to make a script so that it automatically imports 3 columns B, E, N and sorts it so that it ends up like this: (This is for example)
N
Shift (C)
Workshop (E)
Identified root cause, work done (N)
1
01.02.2023
GK
text 2.
OSSH
text 1. text 3
OF&FK
text 4
....
text..text..
....
text..text..
...
text..text..
Night shift
...
text 5. text 6
2
02.02.2023
...
text..text..
I tried many times but I can't do anything. It is also necessary that changes be made to Google Docs automatically when changing the table, but I already know how to do this

Related

Incoherent local/global line numbering in Scinotes

When I switch on the "local line numbering" option in SciNotes, I get a strange effect. The line numbers show as local (starting with the "function" line) for some of my functions, but global (counting from the beginning of the code file) for others.
My first thought was that a function wasn't ended properly (too few "end" instructions wrt the number of opened loops, ifs and other such), but then my code would crash, which it doesn't. Also, indentation looks fine when I auto-adjust it.
It doesn't very much get in my way, but I wonder if it isn't a symptom of something more serious cooking under the surface. Has anybody had a similar experience?
FWIW I'm using Scilab 6.0.2 under Windows 10.
I think I have found the source of the "problem". Line numbering only gets local in a function whose first line (the one with the "function" keyword) is not terminated with a semicolon.
Like this:
1 // This is my fantastic power program
2 clear;
3 clc;
4 cd "c:\myDir\Scilab\Sandbox\FunAndGames"
5
6 function S=square(x); // <-- now you see it
7 S=x*x; // (the semicolon, I mean)
8 endfunction;
9
1 function C=cube(x) // <-- now you don't
2 C=x*x*x;
3 endfunction;
13
14
15 // Now the body of my program:
16
17 X=zeros(5,5);
18 ....

How do I sequentially fill a big range of cells in Google Sheets?

I want to fill an entire column of Google Sheets with numbers from -4000 to 4000, but I can't find an easy way of doing it.
I'm aware of the auto-fill solution of google sheets that allows you to write two sequential numbers and then select them and use the drag-and-drop approach, but for big numbers, this is not a feasible approach.
Is there a way of automating it using some formula or some built-in option?
input 1 in A1
input =A1 + 1 in A2
copy formula from A2
press CMD + Shift + Arrow_down - this will select entire column except first cell
press CMD + V to paste formula
Please try (in Row1 of a big enough sheet):
=ArrayFormula(ROW(A1:A8001)-4001)
make sure you have 8001+ rows and then use:
=ARRAYFORMULA({SORT(ROW(A1:A4000)*-1); 0; ROW(A1:A4000)})
or:
=ARRAYFORMULA(IF(ROW(A1:A8001); {SORT(ROW(A1:A4000)*-1); 0; ROW(A1:A4000)}; ))

SSRS: Trouble understanding Grouping in Report

I have a relatively simple report that is 'working'.
It has a main Group based on an Expression - with one sort in the Group - and then another 'Group' named 'Details' under that in the Row Groups pane.
The Main Group is repeating itself for no reason that I can figure.
I expect that if there is a Group called 'A' - then all the Detail rows in that Group will display till the next Group - right?
Like this:
A
Bob 1 Texas
Jane 2 California
Devin 4 New York
B
Jack 3 Texas
Mary 6 Maine
Peter 5 Michigan
C
. . .
Instead, the report is doing something like this:
A
Bob 1 Texas
Jane 2 California
A
Devin 4 New York
B
Jack 3 Texas
B
Mary 6 Maine
Peter 5 Michigan
C
. . .
If I delete the Details Group I lose some data & the report goes from 5 pages [57 detail recs] to about two pages.
If I delete the Main Group as well - I go down to just one record in the entire report.
I need to keep all the data that is on the report - but have it Group correctly by the Main Group [without repeats of the Group Header] and then within each group - sort by a couple of different fields.
Any idea how I should go about Troubleshooting the issue?
Thanks!!
It looks like there might be something that is Grouping your detail. Make sure that there isn't any grouping on it.
If you can't figure it out, try creating a new one using your old one as a template. I've wasted hours trying to figure out what an issue is but creating a new matrix just takes a few minutes.
I had copied all the cells from the old matrix to a new one I had created and it worked as the first one should have.
I've had this happen a few times and have since given up on trying to figure out why something doesn't work.
I found the problem.
The 'IIF . . . ' Expression for the Group By and the Expression in the Group Header had different field names in the 'False' argument of the two expressions. So the report was GROUPING by one field - but DISPLAYING another field as the Group Header.
I have never done something like that and I can't imagine why I ever WOULD . . . and perhaps that is why I only stumbled on the anomaly because I was copying the two expressions into Notepad to recreate the Matrix and then noticed the difference.
The two field names in the 'False' arguments of the IIF expressions are quite similar - and that was an added reason that it was almost 'camouflaged'.
This is resolved.
Thanks #Hannover Fist! Appreciate that. To copy all the cells, can you just 'lasso' them with the mouse and then Ctrl + C . . . & then create a new Matrix and Ctrl + V? I was on the verge of just re-creating the Matrix.

Wrap long text file but save first X characters for each line

I have a text note file that I need to break up into 200 character lines. But, I need to keep the first 50 characters from the original line as it allows the note file to import into clients system. I have been playing with bash and found fold -50 will fold it at 50 characters and then fold -200 will fold it at 200 characters. Is there a way to take the file and save first 50 but fold at 200 until it reaches the end of the row?
Here is a test of the test file.
PTSTISN1P AA1511200095PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP201506301200FPaaRPTSTISNB PtstisPtstisPtstisOld Patients->Ins Ph #: '(888)888-8888' updated the phone number and called INS to let them know about the number changing. Also, updated number with hospital for Patients contacts.
I need it to save this part for each row it creates
PTSTISN1P AA1511200095PPPPPPPPPPPPPPPPPPPPPPPPPPP
It is not saving all the P's as the first row has a few extra plus a date and time plus user that creates note and the second and remaining rows that info is not needed. Also, even better would be where PTSTISN1P change the 1 into 2 as that is needed for the second, third, etc. lines the 1 is for 1 second and 2 for all remaining lines.
I tried something like:
fold -50 note.txt > newnote.txt && fold -150 note.txt > newnote.txt
but that is not working like I thought it would.

Programmatically adding appointments to Oracle Calendar 10

I'm trying to integrate a Web scheduling appliance with my organization's calendar system, Oracle Calendar 10. Getting meetings out is just a matter of parsing the UNICPOUTR output, and I thought I had a handle on getting meetings in with UNICPINR, but I'm getting a couple of odd errors.
Basically I grab the room description from UNICPOUTR, append the data for the new meeting, write out to /usr/tmp, and try to import the resulting file. I created a test resource to try things out, but something's gone odd. Here's the resource description from UNICPOUTR:
{
F Unison Export File
V A.02.53
E FALSE
X
R a Test Resource
R b
R c 10
R d
R e
R f
R g
I
P 4 480 1080 1 30 190 2 1 60 0 0 10
N 0
}
But trying to use this as a basis for an import file results in the rather odd error:
"R=Test Resource/N=Test Resou/CA=10/LOC=10/PHONE=10/EXT=10/FAX=10/PSW=g"
does not exist
Trying to get a handle on the resource with the -ls flag on UNICPINR, as
unicpinr -ls /usr/tmp/meeting.test
just spits out
unicpinr: file pattern not found - First
after a message on how to use the utility.
Is anybody out there familiar enough with the system that they can tell me what's going wrong here, or better yet suggest an alternate way to get new meetings in?
Okay, so after spending a day chewing on it, I've come up with this solution. There were a couple problems at work here (notwithstanding the -ls which I haven't investigated).
First: while UNICPOUTR will produce blank lines for acceptable nulls in the resource description, UNICPINR will for some reason assume that a blank line means to use the value from the previous line of input.
Second: UNICPINR doesn't seem to be able to search on anything other than the resource name.
Solution: take the resource description block and filter out the lines that start with X (room administrator), I (room password), and "R b" through "R g" (various resource identifiers). UNICPINR can run a search with "R a" just fine.
The resulting import, however, leaves all the meetings thinking they were created (M) and owned (W) by the room itself, but the original creator/owner are in the comments section prefaced by "Event creator: " and "Event owner: ", so I can work with that.
This may be a problem that only I will ever face, but it's responsible to leave the solution, however kludgy, in case someone else is out there groping about blindly. So here it is.

Resources