How to merge all the lines into single line in BBEDIT - edit

How can I merge all the lines into single line by using BBEdit (MAC)
Example:
Sunday
Monday
Tuesday
Wednesday
Expected output:
Sunday Monday Tuesday Wednesday

The "Remove Line Breaks" command on the Text menu will accomplish this.

Related

set Monday is first day of week

I'm using Microsoft sql server and in the sql server by default first day of week is Sunday but I need to set it Monday is the first day of week.
This sets the first day of the week to Monday
SET DATEFIRST 1;
You can use
SET DATEFIRST { number }
number
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday
7 Sunday
Here the link to the official docs:
https://learn.microsoft.com/en-US/sql/t-sql/statements/set-datefirst-transact-sql?view=sql-server-2017
You can use SET DATEFIRST like following.
SET DATEFIRST 1
You can read more about this here and here
Use this command :
SET DATEFIRST 1;
See this post

Get Work week or Number of Weeks T-SQL

How can I get the exact week number if my date range is from Friday to Thursday nextweek?
I used this code
datepart(wk,t.date) as workweek
but the week number is different, maybe because the format that I want to get is from Friday to Thursday nextweek. I hope somebody can answer. TIA!
SET DATEFIRST 5; -- Set Friday as first day of the week
Select datepart(wk,t.date) -1 as workweek
From yourTable as t

Informix SQL to get date range that changes automatically

Please help me with an Informx SQL query to be run every Friday.
Period: 1st of the Month to the Thursday before the Friday that it is being run on. I can't just choose date ranges as it will be an auto report so the dates needs to update automatically. Is there a way to do this?
You've got two issues: the start of the month and the date of last Thursday. The simplest expression to identify the 1st day of the current month is:
MDY(MONTH(TODAY), 1, YEAR(TODAY))
The way to identify the most recent Thursday is via a CASE statement on WEEKDAY(TODAY). Something like:
CASE
WHEN WEEKDAY(TODAY) < 5 -- (Sunday (0) - Thursday (4))
THEN TODAY - WEEKDAY(TODAY) - 3 -- Calc last Sunday, back 3 days
ELSE TODAY - WEEKDAY(TODAY) + 4 -- Calc last Sunday, forward 4 days
END
Note, you will still run into issues where the 1st of current month is later than the most recent Thursday. But hopefully the examples above will point you in the right direction.
Of course, if you know this report is only ever going to be run on Fridays, then calculating the most recent Thursday is just TODAY -1.

Dynamically reboot server periodically using cronjob

I need my server to reboot after every 5 days of uptime
if it is not rebooted and again reboot after exactly 5 days and continue this process consecutively.
I would like to know how to do this with cronjob or any other script
You can use the dow, or Day of Week, part of the crontab syntax, to execute the command on every occurrence of a particular day, using numbers in the form:
0-6 Sunday to Saturday
1-7 Monday to Sunday
Or even shortened word notation such as WED or THU for Wednesday or Thursday
# m h dom mon dow command
00 07 * * 5 your-command-here
The example above would run the command at 7:00 am every Friday

Setting specific day on date field

I would like to set coming Thursday on my SharePoint date field as default date.For example whenever I open the form it should display coming Thursday as default date in Any idea what will be the formula ?
If you want the default value to be "next Thursday", then
a) if today is Thursday and you want the default date to be today:
=IF(WEEKDAY([Today]<5),[Today]+4-WEEKDAY([Today]),[Today]+11-WEEKDAY([Today]))
b) if today is Thursday and you want the default date to be next Thursday, not today:
=IF(WEEKDAY([Today]<4),[Today]+4-WEEKDAY([Today]),[Today]+11-WEEKDAY([Today]))
If today is not Thursday, you get "next Thursday" as expected in both cases.