import – Importing selected data from text files

I have a large number of text files in a folder with different names. These are the output data files from an experiment. Each text file has first 50 lines of text, followed by four columns of numerical data. For some analysis, I want to import the data in all these files to Mathematica in form of tables. However, there are two problems I am facing, will appreciate any help in this regard.

First, the names of these large number of text files are randomly chosen, and I don’t want to mention them manually. Is it possible to tell Mathematica to import all the text files in a folder irrespective of their names?

Second, while importing the data from each file, I want to crop first 50 rows and two columns (2 & 3). Basically I need numerical data in columns 1 and 4 only, from row 51 to end. How to do it? Each set of these two columns (2Xn table) can be named as the name of the text file from which they are taken.

thanks

Print[] text in the style of Message[]

I would like to imitate the aesthetic style of Message() text, but using Print(), and customising the colour. The output I desire is close to:

enter image description here

but I wish to change the colour of the myFunc: prefix, from red to (e.g.) orange.

Sadly Echo() uses a different font and message-text colour:

enter image description here

I can get close using Print() and Style(), but haven’t worked out the text size and font-family of Message:

Print( Style("myFunc: ", Orange), Style("Please ignore the preceding error", Gray) )

enter image description here

How can I precisely imitate Message style using Print()?

email – Microsoft Outlook hiding text after pressing enter

When typing an email, the previous line of text is hidden after pressing enter. Then, the cursor is stuck and can’t be moved.

I’ve checked if it’s deleting the text and it’s not, since when sending the email to a different email, you receive the hidden text as well. I’ve scoured the internet for solutions for this and it’s not Overtype, line breaks, or formatting issues. It does not occur on other applications, only the Outlook app. I’ve also tried repairing the application and that did not work.

I am using Outlook as part of Microsoft Office 365. It is the newest version and my computer is running Windows 10.

interaction design – Subsequent editing of inline “click to enter text” fields

I’m iterating on a SaaS platform where there is a notes functionality on certain elements which are shared between all users of the platform.

Currently, it’s handled via the notes section starting out with a “Click to enter text” empty state.

Clicking note text is also the only way to launch into editing once a user has written a note.

While the means of editing that field may be clear for the first user who see’s the empty state, I worry that losing that signifier could hurt visibility for subsequent users reading the note who may want to edit.

I plan on examining this (among other things) to a certain extent in some user tests/interviews, but I’d appreciate insight any of you may have as well!

enter image description here

text processing – How to make the output of command “tor” to print the last word which is “Done”?

So, when I run the command tor in cli it shows something like this:

May 10 22:41:08.743 (notice) Tor 0.4.5.7 running on Linux with Libevent 2.1.12-stable, OpenSSL 1.1.1k, Zlib 1.2.11, Liblzma 5.2.5, Libzstd 1.4.8 and Glibc 2.31 as libc.
May 10 22:41:08.743 (notice) Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
May 10 22:41:08.743 (notice) Read configuration file "/etc/tor/torrc".
May 10 22:41:08.744 (notice) Opening Socks listener on 127.0.0.1:9000
May 10 22:41:08.744 (notice) Opened Socks listener connection (ready) on 127.0.0.1:9050
May 10 22:41:08.000 (notice) Parsing GEOIP IPv4 file /usr/share/tor/geoip.
May 10 22:41:08.000 (notice) Parsing GEOIP IPv6 file /usr/share/tor/geoip6.
May 10 22:41:08.000 (notice) Bootstrapped 0% (starting): Starting
May 10 22:41:09.000 (notice) Starting with guard context "default"
May 10 22:41:10.000 (notice) Bootstrapped 5% (conn): Connecting to a relay
May 10 22:41:10.000 (notice) Bootstrapped 10% (conn_done): Connected to a relay
May 10 22:41:10.000 (notice) Bootstrapped 14% (handshake): Handshaking with a relay
May 10 22:41:11.000 (notice) Bootstrapped 15% (handshake_done): Handshake with a relay done
May 10 22:41:11.000 (notice) Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits
May 10 22:41:11.000 (notice) Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits
May 10 22:41:11.000 (notice) Bootstrapped 95% (circuit_create): Establishing a Tor circuit
May 10 22:41:12.000 (notice) Bootstrapped 100% (done): Done

Now, what I want is to only print the last word of last line which is Done

When I tried tor | grep Done, I got this:

May 10 22:41:12.000 (notice) Bootstrapped 100% (done): Done

When I tried

  • tor | cut -d " " -f 8
    or
  • tor | cut -d " " -s -f 8
    or
  • tor | awk -F " " '{print $8}'

PS: I don’t understand the difference between first two, I’ve tried man cut. I’M A NEWBIE.
So, with the above three commands, the result was:

on
you
"/etc/tor/torrc".
on
connection
file
file
Starting
context
Connecting
Connected
Handshaking
Handshake
Loaded
Handshake
Establishing
Done

Now, when I combined “grep” and (“cut” or “awk”) as shown below,

  • tor | grep Done | awk -F " " '{print $8}'
    or
  • tor | grep Done | cut -d " " -f 8
    or
  • tor | grep Done | cut -d " " -s -f 8

or by writing the grep command after cut or awk
there is no output:


But it should have worked as I’ve seen on many discussion forums before asking it here.

Are my packages broken?
Or is there something fishy with tor command?

usability – Bottom navigation: Colour on selected text?

Why is it so common that at bottom navigation many apps choose a highlight colour that is hard to read?

Why don’t they use a different colour to highlight and a different colour for the text?
Is it just aesthetics or I’m missing something?

Examples (of what I consider hard to read):

enter image description here

enter image description here

enter image description here

Example of what I think we should be seeing more:

enter image description here

enter image description here

Google Sheets: How do I identify text in a column of cells and use a relative cell for addition if specific text is found?

I am looking to make a function that finds if a name (string) is in a particular cell, and then add the cell 2 columns over every time that specific name is found.

I think im looking for a type of if statement that identifies if any of cells from x to y have a specific string, then adding all the cells 2 to the right of every time the string is identified.

Specifically, I am calculating run differential in a baseball stat keeping sheet. I currently have it set up so The columns of the game logs are as follows: WINNER, LOSER, RUN DIFFERENTIAL. I am looking to create a function which finds the run differential each time that specific team played.

Example: if Team A won by 9 in their first game, the name of their team would be in the WINNER column, followed by the team they beat in the LOSER column, and then finally followed by the RUN DIFFERENTIAL (+9) which shows how much Team A, the WINNER, beat TEAM B by, the loser.

I think the idea is to first locate where the team won and lost. A team’s name in the win column indicates a win and is easy to identify, so my initial idea was to give a simple if statement for wins (If name is found in this cell, ADD the run differential which is 2 rows over, meaning they won by that much) and then sum whatever that number comes to with all the times they’re found in the loser column and the run differential of all those times, which would be how much they’ve lost by.