Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 years ago. Improve this question I want to change a text file that contains for example : a 1 b 2 a 3 b 4 to: a b 1 2
Tag: linux
Linux – flip last bottom lines only, with awk
We are currently learning some awk commands to manipulate/rearrange text on files. our original text goes like this..1998 It’s asking us to rearrange the columns (part one) which i already did.. but at the same time to flip the bottom two lines (part two) so that it looks like this again, i got the orde…
Programming in Linux – FIFO
I have created fifo, try to write to it: echo “text” > myfifo and read it with my programm. But when I write to fifo nothing shows. I have tried many options, turning off and on NON_BLOCK mode and so on but nothing seems to help. Answer This needs to be (there’s probably no need for the O…
Tail a log file on linux and trigger a script if words are matched
I’m looking for a way to watch multiple logfiles on linux and look for words or phrases inside and if found, trigger a script or action, this will need to be constant. I know this can be done with some grep, tail hack but I want to know if there is something premade for this with config options, for ins…
How to install folders from index to windows or linux? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …
Split TTY device based on packet type
I have a TTY device setup to monitor a serial port of a combined bluetooth/GPS chip. I’m using blueZ to implement the bluetooth stack and do everything bluetooth related. The data being sent across this port is all HCI packets, even the GPS data. The GPS data is wrapped in an HCI packet of type 0xXX (in…
chown and chmod doesn’t work (Raspberry Pi 2 – Jessie)
I would like to make a fileserver at home using Raspberry Pi 2. Currently there are 3 users: root, pi and alma. My connected external drive is mounted automatically to /media/pi/TOURO I would like to share “Share” directory on this drive for “alma” users (with read+write permissions) T…
How to read the external timer counter on the BeagleBone Black?
I need to count the transitions of a 50KHz binary signal using a BBB. I think using the TIMER4 triggered by the external signal connected to the pin P8.07 would be the easiest way. So, I issued the following commands to load the proper cape and setup the pin as a timer : Everything seems to work and nothing a…
Summing columns in a text file
I have a data file that looks like this: and so on……till TOPIC:topic_2000. The first line is the topic and it’s weight. That is, I have the words in that specific topic and their respective weights. Now, I want to sum up the second column of each topic and check what value it gives. That is,…
diagnosing when I’m being limited by disk i/o
I’m running Python 2.7 on a Linux machine, and by far the slowest part of my script is loading a large json file from disk (a SSD) using the ujson library. When I check top during this loading process, my cpu usage is basically at 100%, leading me to believe that I’m being bottlenecked by parsing …