Ubuntu :: Edit A Line In Vim?

Jul 28, 2010

When I want to edit a line in vim, I type the : followed by a number to go to that line. So for example ":8" would go to line 8. I was wondering if there was a way to omit the : character, so I would only have to type 8 and it would go to 8.

View 7 Replies


ADVERTISEMENT

Ubuntu :: [bash] Edit The End Of The First Line In A File?

Jan 18, 2010

if I can create a bash script that once executer will edit or replace a line a in a file this line is the first one and its just one character that needs to be changed from a 1 to a 0.

How do I go about this? it is for a game called EVE Online, heres what my .sh look like atm

#!/bin/sh
echo fixing prefs.ini
#fix for prefs goes here
echo starting eve
eve

View 4 Replies View Related

Ubuntu :: Edit A File In Text Line Mode?

Oct 21, 2010

I just modified the grub file in 10.10 in order to see what the text line boot is like. Well now I want to go back, but when I try to gedit /etc/default/grub it gives an error that he couldn't display. How can I edit the file to go back to gnome??? I am on macbookpro 6.2 tripleboot Mac OS 10.6, Win7 and Ubuntu 10.10.

View 3 Replies View Related

General :: Edit Last Word On Each Line In File?

May 28, 2010

I have a file which a number at the end of each line. I need to change this number in the file to be correct, i.e. each time the number is 9 it needs to be 1, each time it is 233 it needs to be 2, etc... There is no pattern to the numbers currently in the list other than the same number appears only in a single line/group of lines, not throughout the file, but the replacements need to be sequential (but can be repeated an arbitrary number of times).

[Code]....

View 10 Replies View Related

Fedora :: Open A File Using Command Line In Terminal And Edit Code Within It?

Jun 10, 2011

How to open a file using command line in terminal and edit the code within it ?code...

View 6 Replies View Related

Ubuntu Security :: Edit Grub.cfg File To Add The "pci=routeirq" Code To The Kernel Line?

Sep 2, 2010

I'm looking to edit my grub.cfg file to add the "pci=routeirq" code to the kernel line so I can configure my modem in Ubuntu. I'm happy with assigning a temporary permission to myself over the root file so I don't accidentally alter it later.

View 3 Replies View Related

General :: Edit Grub Menu From Initial Grub Screen - Possible To It's Own 'e' Option Or 'c' From Grub Command Line?

Nov 20, 2010

my Setup is Fedora 14 x64 + radeon hd 4830 i've downloaded .run package from ati site with latest driver for x64 systems. installed it, but didn't edited grub.conf becouse i didn't understood anything there (probably didn't spent enough time to get things understand) Now i've lost possibility to enter my Fedora system. during boot it lost it's modern blue boot screen (with filling drop), it was replaced by standard old boot screen with triple-color stripe. after this boot screen monitor start blinking going on and off. and on last step i'm getting "Fedora 14 boot bla bla bla something" on screen. nothing works except Ctrl+Alt+Delete. system reboots showing successful daemons shutting sequence. How can i edit grub menu from initial grub screen is it possible to it's own 'e' option or 'c' from grub command line?

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

Code:

View 10 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

Programming :: Compare Two Files Line By Line And Print The Line Which Is Same?

May 30, 2011

I am trying to write a program in C which compares two files and prints the line that is equal.

Here file1.txt has

and file2.txt has

Note: file2.txt consist of only a single string where as file2.txt has multiple lines. Actually im comparing two files with md5sum values.

Here is the code but it compares only first line of files..but it should compare the whole file1..and sorry iam a beginner in C can any1 sujest some modification to this code so that..it can compare file2 with entire file1

Quote:

View 9 Replies View Related

Programming :: Insert Line Using Sed Or Awk At Line Using Line Number As Variable

Jul 25, 2011

I want to insert a line at a particular line number using sed or awk. where line number is not fixed and is in form of variable.

I want to use variable in sed or awk command.I tried something like below, but no luck.

View 7 Replies View Related

Ubuntu :: Edit File Inside It, Open It, Edit A File, Then Remake The Bin File?

Mar 3, 2011

I have a linux.img image for ubuntu.I want to edit file inside it, how can open it, edit a file, then remake the bin file?

View 7 Replies View Related

Programming :: Programing - Reading File Line By Line Then Char By Char In Each Line

May 29, 2010

I've never programed shell scripting.

Code goes like so:

I simply want to read a file "data.txt" line by line Then char by char and add them into a result var. The file is supossed to always contain numeric values

View 8 Replies View Related

Fedora :: Edit "Places" Menu Way One Can Edit "Apps" And "System" Menus On Gnome?

Jan 14, 2010

Is it possible to edit the "Places" menu the way one can edit the "Applications" and "System" menus on gnome?

Right-clicking on the bar gives only Applications and System as editable menus. I would like to remove some items from the places menu and add others of my own liking

View 4 Replies View Related

Debian :: Edit Link Target / Edit The Link Target To Force Ip String At End?

Jun 16, 2011

What I am trying to do is edit the link target to force ip=xxxx.xxx.xxx string at end. I have a software program which access 4 different servers running the software but with different configs. In xp I can copy links and modify as above to correctly force the program to the various servers.

I have read the various how tos on hard vs sym links which I get. Playing around with hardlinks and sysmlinks (the examples I find) does not seem to be what I need. Feel like this is pretty basic stuff but I am a bit stumped.

View 1 Replies View Related

General :: Create Cron Tab When DSL Line Down Set Automatically Restart The Network Service While DSL Line Up?

Oct 7, 2010

How to create cron tab when DSL line down set automatically restart the network service while DSL line up?

View 3 Replies View Related

Software :: Grep Query To List 1 Line (which Is Fixed) And The Next Line After It (variable Text)

Jan 20, 2011

How can I list the following with grep. I want to extract 2 lines fron a text file The fixed known part if it exists will static text and the text line after it will change.

A sample file
.
.
textline1

[code]....

If the fixed part does Not exist how can I return error code 1

View 3 Replies View Related

Programming :: Create File Listing In C++ That Will Generate Line Number On Every Line Of Code

Apr 11, 2010

I have a project due for my Intro to C++ class and we are suppose to generate a file listing that will take an input of a C++ source code with .cpp extension and make a copy of it with a .lst extention that will have a line number preceding each and every line.

View 12 Replies View Related

Programming :: Set Indent In .emacs To Enable New Line Starts From The Same Position Of Previous Line?

Dec 29, 2010

How can I set indent in .emacs to enable my new line starts from the same position of previous line?

like this;

Hello world <enter>
Second Hello world // "S" starts right under first line's "H"

View 4 Replies View Related

General :: Getting The Line Of String From Previous Pipe Output By Line Number?

Feb 8, 2010

After running the following command, I get:

[root@yukiko /]# find / -iname .bashrc
/home/clamav/.bashrc
/home/vpopmail/.bashrc
/etc/skel/.bashrc
/root/.bashrc

But I would like to have a command that prints a specific line by supplying the command with the line number, for example:

[root@yukiko /]# find / -iname .bashrc | getline(2)
/home/vpopmail/.bashrc

Is there such a command on CentOS?

View 3 Replies View Related

General :: Script To Count # Of Chars Per Line - If Line Meets Certain Criteria - And Get Avg #?

Sep 11, 2009

I have several files with many lines something like this:

I'm trying to write a script that will count the number of characters per line that doesn't contain a ">" symbol and give me an average of those values. I have most of the script together but I can't figure out how to connect some of the steps.

Code:

View 3 Replies View Related

General :: Scripting - Feed An Input File Into An If Statement Line-by-line

Dec 23, 2009

I am trying to write a script that takes an input file ($FileName) and an intermediate file ($FileName.info) and removes lines from $FileName if the value in $2 of $FileName.info is <75.

I can't figure out how to feed only one line of the .info file to the if statement at a time so that it will perceive it as an integer instead of a list.

The error I am getting now is ./script.sh: line 6: [: : integer expression expected

Sample input $FileName

Code:

Code:

Code:

Script so far:

Code:

View 10 Replies View Related

Software :: Use Command Line To Split A Single-lined XML Into A Multi-line XML?

Dec 9, 2010

I have a many text files that have XML tags all shoved into 1 line. I want to create a new file that splits each XML tag onto a new line. code...

View 3 Replies View Related

Programming :: Adding Line From File1 Into A Line Of Another File Based On Maching IDs

Jan 3, 2011

I wish to add information to one of my files based on matching IDs,

Here is an example

(the id is the 3 colunm)

(the ID is the 2 colunm)

And the output i wish to be

OUTPUT:

So as you can see the ones that do not match are still present, and the ones that do match just have the extra information from file2.txt added to them.

I thought about using join but that only seems to join the ones that match displays thoes only. i would like all the information in the output file.

View 6 Replies View Related

Programming :: BASH: Each Line Of Multiple Text Files Gets Added To One Line?

Sep 12, 2010

I currently have 3 files with floating point data that I wish to have in a single file with the format:

Code:

F1 F1 F3 Output
a1 b1 c1 a1 b1 c1
a2 b2 c2 a2 b2 c2
a3 b3 c3 a3 b3 c3
a4 b4 c4 a4 b4 c4

View 3 Replies View Related

Programming :: Perl Script To Replace Line After Finding Previous Line

Feb 28, 2011

At the moment I have a flat file which is being used by a few people. I want a script to remotely change the file, so I can start logging who is doing what.At this point here is one requirement I am trying to develop. We have text blocks who pretty much look like.I hope this is somewhat clear. I try to find $param for the right $workflow and change that. Can you help me to find $$var3 and change that?

View 1 Replies View Related

OpenSUSE Install :: Red Line Of Error Msg During Boot System Console Stolen At Line: 266 SuSE11.4?

Apr 29, 2011

...../etc/init.d/before.local...System Console Stolen at line: 266 This line of red warning consistently appears immediately after something that ended with /etc/init.d/before.localThis is during the boot.Have anyone see it before ?It appears both in kernel versions:2.6.37.6-0.5-desktop2.6.37.1-1.2-desktop

View 3 Replies View Related

General :: Parse A File And Print Each Line That Ends With Matching Pattern (if The Next Line Is Blank)

Aug 2, 2010

I've written a script to parse a file and print each line that ends with matching pattern, if the next line is blank. The pattern lines are the result of md5sum $i|sed 's/path///g' so that only md5 and filename appear. Here's what I'm using.

Quote:
for fline in `sed -n '/.*.ext$/p' file1`
do
if [ "`sed -n -e '/'"$fline"'/ {n; p;}' file1`" == "" ]
then
echo ""$fline" has no info" >>file2
fi
done
[Code]....

View 4 Replies View Related

Programming :: Open Two Text Files - Read Them Line By Line And Update Parameters Of The 3rd File ?

Oct 18, 2010

I have two txt files containing x and y coordinates: xcoord.txt & ycoord.txt. I need to open them; read them line by line to get each coordinate; then each time I need to update Xs and Ys parameters inside another file called "dc.in" with the grabbed values.

Finally each time I need to run two exe files ( dc_2002 and st_vac) and produce corresponding output for each Xs and Ys ( dc.in is an input file for this exe files)

I have written the following code but it does not work:

View 14 Replies View Related

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







Copyrights 2005-15 www.BigResource.com, All rights reserved