Debian :: Add Tabs At The Beginning Of Each Line?

Dec 6, 2010

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?

View 1 Replies


Programming :: Perl - Delete Line From Text File With Duplicate Match At Beginning Of Line

Apr 1, 2009

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.

View 7 Replies View Related

Programming :: Add String On The Beginning And End Of The Line ?

Aug 3, 2010

I need to output of a script to a file with tags.

I'm trying sed and was able to put a tag on the end of the line


Output is


What I need to have is


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.

View 2 Replies View Related

General :: Bash - Add Text At The Beginning Of A Line

Feb 28, 2011

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)


View 6 Replies View Related

General :: Insert Tab At Beginning Of Each Line In File?

Aug 5, 2010

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.


loginfile.txt has


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

Where the columns are separated as below.

1[tab][tab]User1[tab]date +%D[tab]12/31/9999
2[tab][tab]User2[tab]date +%D[tab]12/31/9999
3[tab][tab]User3[tab]date +%D[tab]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.

View 2 Replies View Related

Programming :: Function Which Removes '#' From Beginning Of Line?

Apr 16, 2010

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?

awk '
!/^#/{ sub(/^[^#]*/,"#$0","'$line'")
/^#/{ sub(/#/,"","'$line'")

View 14 Replies View Related

Programming :: Expect: Reacting On A $ At The Beginning Of A Line?

Oct 17, 2010

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:

$" { interact }
However it doesn't.
This is debugging output:
expect: continuing expect
expect: does " " (spawn_id exp6) match glob pattern "#"? no


View 3 Replies View Related

Programming :: Sed - Replace All Spaces At Beginning Of Line With The Number 1?

Jun 21, 2010

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 :

Logical device information
Logical device number 0
Logical device name : RAID1Mirror
RAID level : 1
Status of logical device : Optimal


Logical device information
Logical device number 0
111Logical device name : RAID1Mirror
1111RAID level : 1
11111Status of logical device : Optimal

View 12 Replies View Related

General :: Sed Command - Find Line Not Beginning With Double Quote

Mar 15, 2011

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.

"line 1"
line 2
Output with existing sed command is:
line 1ine2
I need it to be line1line2.

View 9 Replies View Related

OpenSUSE :: Firefox Is Slow Opening New Tabs/switching Between Tabs

Mar 25, 2010

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

View 5 Replies View Related

Debian Installation :: IMac G3 - When Partitioning The HD - Just Shuts Down And Restarts From The Beginning

Jul 31, 2011

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!

View 6 Replies View Related

Debian :: How To Work With Tabs In New Gnome-terminal

Sep 24, 2015

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.

Code: Select allgnome-terminal --tab-with-profile=Titleable -t "sami" -e "byobu" --tab-with-profile=Titleable -t "root" -e "sudo -i screen -dRRS sami" --tab-with-profile=Titleable -t "samimox1" -e "ssh root@samimox1 -t screen -dRRS main"

Can I install older gnome-terminal side-by-side the "new and improved" version? Or is there a way to get tab profiles to work with the new one?

View 7 Replies View Related

Debian :: Saving Multiple Tabs On Iceweasel 4.0x?

May 17, 2011

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

View 14 Replies View Related

Debian Multimedia :: System Hang Up Opening 2 Tabs Chromium

Mar 14, 2016

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

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 ...

View 2 Replies View Related

Programming :: Copy And Replacing Specific Line From File1 To File2 Line By Line

Mar 22, 2011

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.


View 10 Replies View Related

Slackware :: NTP Log Error Beginning In 13.1

Aug 4, 2010



Never seen that error before, always just used the default /etc/ntp.conf file adding servers:


Have I missed something all these years?

Thing works just fine, syncs up, rolls pool servers, does all it's supposed to.

View 5 Replies View Related

Programming :: Access A File Line By Line, And Check The Length Of Each Line.

Feb 13, 2011

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?

View 1 Replies View Related

Fedora :: How To Setup VSFTP From Beginning To End?

Jan 3, 2011

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.

View 5 Replies View Related

General :: Deleting A File Beginning With '?'

Jan 26, 2010

I have found a file beginning with a question mark in my home dir, not sure how the hell it got there. It's from a downloaded rar i think.

Does anyone know how to do this?

View 14 Replies View Related

Programming :: C - Return To The Beginning Of A File?

Dec 16, 2010

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?

View 3 Replies View Related

Debian :: Installing Command Line Debian Squeeze System On Eee PC 701

May 29, 2011

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.

View 14 Replies View Related

Fedora :: Entire HDD Erased At The Beginning Of Installation?

Mar 3, 2010

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?

View 9 Replies View Related

OpenSUSE :: Add 32 Seconds Of Nothing To Beginning Of Video File?

Mar 6, 2010

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

View 7 Replies View Related

General :: List Files Beginning With Underscores First When Using `ls -l`?

Aug 3, 2011

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:

malbert@dredg:/tmp/1$ ls -l
total 0
-rw-r--r-- 1 malbert domain users 0 2011-08-03 15:27 fileA
-rw-r--r-- 1 malbert domain users 0 2011-08-03 15:27 _fileB
-rw-r--r-- 1 malbert domain users 0 2011-08-03 15:27 fileC


I've dug through the ls man page and could not find anything. Is there somewhere a system-wide collation option? Or something the like?

View 1 Replies View Related

General :: What Shell Allows Recalling Commands With Certain Beginning

Sep 14, 2011

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.

View 3 Replies View Related

Ubuntu Servers :: Setup The Server From The Beginning

Oct 8, 2010

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?

View 9 Replies View Related

Ubuntu :: Find And Replace With Sed At Beginning Of A Word

Nov 15, 2010

I want to write a small script to rename a bunch of files. Their name is of the form 'long number'|'name'|'extension', for example:


I would like to rename these to:


If in my script I use something like

sed s/[0-9]//g
on each file, I will get
Football_part.flv, instead of Football_part2.flv,
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?

View 2 Replies View Related

Ubuntu :: At The Beginning Of The Installation My Display Goes Black?

Feb 7, 2011

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

View 7 Replies View Related

General :: Convert String To Number Without 0 In The Beginning

Jun 8, 2010

I want to convert strings like 002, 049, 050, 100 to numbers: 2, 49, 50, 100.

I tried to use:
`printf "%5d" $i`
, but it doesnt work , it convert:

View 11 Replies View Related

General :: Erasing From The Cursor Up To The Beginning Of The Following Word In Vim

Dec 13, 2010

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:


If I now hold <CNTL> down and press <T>, the result will be


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.

View 6 Replies View Related

Copyrights 2005-15, All rights reserved