I want to add something at the end of each line, from line 4 to line 8, in vim? How can i do that? I know adding at the beginning is like: 4,8: normal: i# What i want to add contains special characters ( here it is: <br/> ) , in case that matters.
I want to add tabs at the beginning of each line, from line 6 to line 12. How?
Was wondering if any perl guru's could help me with a quick log file adjustment. I have a text file that looks like so (tabs and newlines are revealed so you can see what separates the data):
There are maybe 100 lines of text in this file at any given time. I need to delete all duplicate lines only looking at the first bit of text prior to the first tab. It doesn't matter which one gets deleted as long as there are no two lines that begin with that same text at the beginning before the first tab. So in this example, either the fist line "1234" or the last line "1234" would need to be deleted. I already have code in my script that opens the files - I just need the code to read the text into an array and the part that would find matches based on the above criteria, and make the deletions.
If it would be easier, I can even do a system call and use SED (v4.1.5) and/or AWK (3.1.5) instead.
I'm trying sed and was able to put a tag on the end of the line
Code:
Output is
Quote:
What I need to have is
Quote:
I'm thinking of I redirect my first sed command to a file and then use sed again to put <group> at the beginning of the line. My problem is how to put <group> to all beginning of the string.
I have a lot a folders, each named by a number, and in each of these folders I have a specific file (stddev.dat) containing a single line (of numbers) I need to have a single file with each line being one of the stddev.dat (no matter if it is sorted or not), and also I need to add at the begining of each line the number of the folder it comes from.
I 'm no bash expert, and the "add at the begining of the line" is a bit of problem to me". Here is what I've come up with so far, just to put everything in one file, (and also if you know a better/more elegant way to do the same thing I've done, I'm listening)
I am trying to create a shell script where a user can specify a file with a list of logins and the script will create a batch file with specific information in specific columns.
Example:
loginfile.txt has
User1 User2 User3
I need the output to be as below:
1 User1 Date 12/31/9999 2 User2 Date 12/31/9999 3 User3 Date 12/31/9999
I can use the nl utility to get the numbers easily enough, but I need two tab separations between the number and the user list. Is there a sed command that will insert at the beginning of each line? If so I can just run nl after I get some tabs up in the front.
I try to do a function which removes '#' from beginning of line. But if there is not '#' then add it on beginning of line. I try something like this, can you correct me?
I am having some difficulties with an expect script. What I want is that as soon as expect sees a newline followed by a dollarsign ($), that interact is done. So I would expect something like this to work:
Code: " $" { interact } However it doesn't. This is debugging output: Code: expect: continuing expect expect: does " " (spawn_id exp6) match glob pattern "#"? no
Does any one know what syntax i could use to allow me to replace all instances at the beginning of a line with ones.
Before :
Code: ---------------------------------------------------------------------- Logical device information ---------------------------------------------------------------------- Logical device number 0 Logical device name : RAID1Mirror RAID level : 1 Status of logical device : Optimal
After
Code: ---------------------------------------------------------------------- Logical device information ---------------------------------------------------------------------- Logical device number 0 111Logical device name : RAID1Mirror 1111RAID level : 1 11111Status of logical device : Optimal
I need to find each line in a file which does NOT begin with a double quote (") and append that line to the previous line. I have been successful doing this using the following command: cat filname.csv | sed -e :a -e '$!Ns/ [^"]//;ta -e 'P;D' > newfilename.csv
My issue is the substitution. As you would expect after the line is appended to the previous line the first character is removed. I need it to not be removed. I tried: cat filname.csv | sed -e :a -e '$!Ns/ [^"]/&/;ta -e 'P;D' > newfilename.csv but it just hangs.
Goal: Input: "line 1" line 2 Output with existing sed command is: line 1ine2 I need it to be line1line2.
Firefox is sometimes slow opening new tabs/switching between tabs. If I click on the kickoff application launcher button, it takes a few seconds to open, and typing something in the search makes it hang up for about 20 seconds before it does the search. Clicking on an app takes 16 seconds before the menu window closes and the program begins to start. Then it takes another 30sec-1min before the app is usable. smplayer plays video with tearing.
Like right now I tried taking a screenshot, and it tells me
Error launching /usr/share/applications/kde4/ksnapshot.desktop. Either KLauncher is not running anymore, or it failed to start the application.
while the app worked fine.
I also tried running glxgears right now, and it runs but the gears don't move, and terminal states
15 frames in 19.0 seconds = 0.789 FPS XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0" after 48 requests (48 known processed) with 15 events remaining.
If I'm on dolphin, and I click a video to start smplayer, it takes about 1 minute for it to start.
Memory is using 1.4GB out of 3.6GB, with 0.08GB/2GB swap
Top shows an average usage of less than 10% average. Xorg is always 25%, kwin is always 10% and then rest of the apps are less than that.
CPU: AMD Athlon(tm) II X4 620 Processor Integrated VIdeo: HD4200 with fglrx driver
When I ssh into the computer with x tunneling, the programs start up faster than being on the desktop
I have downloaded the latest version of Debian for PPC to run on my iMac G3 600MHz 1GB ram. The problem is, is when it is partitioning the HD the computer just shuts down and restarts from the beginning. I don't understand this. I chose it to erase and use the entire disk. The HD is 80GB. I really want to install this OS!
After going Debian 8 (with Kali 2) I can no longer use my pre-defined tabs because apparently some genius decided that gnome-terminal no longer needs that kind of functionality (ie. tabs.)I really need my tabs back so I installed a pre 3.11 version that worked with tabs and profiles like this (see below) but that caused other problems.
I'm running Iceweasel (amd64 architecture) version 4.0.1 on Debian Wheezy/Sid/Experimental.My problem is getting Iceweasel to restore saved multilple tables when restarting it. I have done all the obvious things like setting the browser.tabs.warnOnClose, ...warnOnOpen, browser.warnOnRestart, ...warnOnQuit to TRUE. I get a dialogue box when I exit asking if I want to restore my tabs when I restart and I click "Save and Quit" but then when I do restart... no tabs
My system currently freeze entire UI more frequently when opening more than 1 tab in chromium. not relate to any specific web page but especially on [URL] ....
Code: Select allĀ uname -a Linux GlobeTravelers 4.3.0-1-amd64 #1 SMP Debian 4.3.5-1 (2016-02-06) x86_64 GNU/Linux
chromuim Version 49.0.2623.75 built on Debian stretch/sid, running on Debian stretch/sid (64-bit)
I google and found lot of chromium freeze UI bug reports on Ubuntu, Fedora, Osx ...
I have two files, file1.traj and file2.traj. Both these files contain identical data and the data are arranged in same format in them. The first line of both files is a comment.
At line 7843 of both files there is a cartesian coordinate X, Y and Z ( three digits ). And at line 15685 there is another three digits. The number of lines in between two cartesian coordinates are 7841. And there are few hundreds of thousands of lines in a file.
What I need to do is copy the X Y Z coordinate (three digits) from file1.traj at line 7843 and paste into file2.traj at the same line number as in file1.traj. The next line will be 15685 from file1.traj and replace at line 15685 at file2.traj. And I dont want other lines (data) in file2.traj get altered. This sequence shall be going on until the end of the file. Means copy and substitude the selected lines from file1.traj into file2.traj.
I tried to use paste command but I cant do for specified line alone.
Here i showed the data format in the file. I used the line number for clarity purpose.
I want to access a file, and check the length of every line.After, i want to check and replace all lines with length over 10 characters, with a message.Does anyone have a clue on that?
I am new to Fedora 12 and was trying to setup a FTP server using VSFTP. I have it installed, but not sure where to go from there. I ultimately would like to have all of my PC( that are on the same subnet to be able to access the ftp server) and possible be able to access the server from outside of my local network.
I'm reading a text file with fscanf using a loop until feof(inFile). How can I return to the top of the file? As in I have one loop that scans until the eof and then after it there's another loop and I want to start from the beginning of the file again scanning to the end of it. How do I get back there?
I have been trying to install a command line Debian Squeeze system on n Eee PC 701., but have run into a number of problems:
1) All install info I can find assumes that the person wants to install a GUI system of some sort. 2) The Eee PC has a unique 2 MB. partition that needs to be preserved, so no guided install. 3) The Eee PC has an SSD instead of an HD. Most postings I have seen recommend an install without a swap partition, but the install (both live and text) seems to choke and despite a fresh formatting of the existing partition, claims to be overwriting existing files. 4) I can understand from the wiki that the Eee PC wireless driver (Atheros) should be included in Squeeze, but when the wireless connection and password is added, the installer claims that the password is not correct, despite me having checked it a number of times.
I hope someone can help me out. I just want to use the Eee PC for low resource stuff done on the cli like using a text based web browser to access the net through a wireless router and to hook it up to an external USB HD and to my stereo, to play my music collection.
I just tried installing Fedora 12 and at the beggining of the install i got this message about my disk which cannot be read until it is initialized, and if i initialize it all data on the disk will be lost. Disk was formated using GUID, and had one HFS+ partition on it. I accidentaly clicked "yes" on that error message, and after realising what I just did (some 2sec later) i pulled out my computer's power cord out.
Now my entire disk is erased, it has no partitions on it, and all data is lost...
How do i retrieve my data from the erased disk, and why did Fedora want to do this to my disk?
Movie and translation are 32 seconds out of sync. There are 2 ways to resolve:
1. edit all zillion lines of translation (daunting, I couldnt find tool)
2. add 32 seconds of nothing or whatever to the beginning of a video file
No2 may be quicker, but I do not know how.. I am not good with ffmpeg... also, if I want to join some 32 seconds, lets say of my XVid recording, I need to prepare it to be the same as film, so it is also complicated. how to add 32 sec? I tried openShot (couldnt find option). Cinellera is giving me strange errors, about audio codec and something I dont understand... I am confused in using both tools
I'm using ubuntu (natty), and when I use ls -l, the files are listed, but apparently the sorting algo ignores any special characters. For ages I've used underscores to mark special folders. And it seems to me, that they were always listed first. Now, the underscore is completely ignores. Let's assume that I have the files fileA, _fileB and fileC in a folder. Currently, ls -l orders them like so:
Programs like matlab/octave and I'm sure many other ones allow you to start typing a command, and then hit Up to recall the last command that starts with the typed characters. Common linux shell bash doesnot do this. Is there a different shell that does? I'm not asking how to find out the last command, I'm asking if there's a shell that's a little friendlier.
I am completely new to everything linux, however I decided that it was time to do something with an old pc I had and I was thinking of setting it up as a home server. I look around for an easy guide on how to set up the server from the begining but I can't seem to find one that's good for a complete beginner like me.What I would like to do is to had the server as a place where I keep all my movies, music etc and be able to acces it from my home network and also from outside of it. Also, I would like to connect my two printers to this server and share them on the network.
Is there a place where I can find simple information about what I want to do and is it possible for a complete beginner like me to do what I want to do?
Code: sed s/[0-9]//g on each file, I will get Football_part.flv, instead of Football_part2.flv, and Nice_weather__ducks.flv, instead of Nice_weather_4_ducks.flv.
how to instruct sed to only remove numbers that are in the beginning of the name in a simple way?
I was trying to install my ubuntu into my laptop , at the beginning of the installation my display goes black , I searched and changed to nomodeset . I could Install it and after reboot my ubuntu didnt work again , black screenand next I did this :On the Grub Menu, I select "Ubuntu, with Linux 2.6.35-22-generic" and press "e" so I can edit the boot parameter.
On linux /boot/vmlinuz-2.6.35-22-generic root=UUID=3df857a3-9c1b-4fd3-b0fc-52838eaa2023 ro quiet splash I changed it tolinux /boot/vmlinuz-2.6.35-22-generic root=UUID=3df857a3-9c1b-4fd3-b0fc-52838eaa2023 ro nomodeset singleand press 'ctrl-x' and log in the startx .it worked but I couldnt save this setting so for every reboot I had to do all things above .after that I download and install the Nvidia driver for ubuntu , but after restarting it went to froze purple screen
In a wide family of "ancient" text editors, by pressing ^T you erased from the cursor up to the beginning of the following word. If we use '_' to represent the cursor, the thing was like this:
Code:
If I now hold <CNTL> down and press <T>, the result will be
Code:
Want to feel at home with vim. Many times I have consulted and even tried to systematically study vim's man page. Sometimes I consulted it with profit, sometimes not. This is one of the latter.