General :: Repacing A String At A Specific Location With Another In Vi (gVim)?

Mar 18, 2010

If i have a comma separated string like this one

Code:
aa,bb,cc,dd,ee
11,22,dd,3f,22

[code]....

View 6 Replies


ADVERTISEMENT

Programming :: C - Put A Specific Arbitrary Part Of A String Into It's Own String?

Apr 18, 2010

So if I'm given a location of a file like:

How can I just take the type of the file at the end? I know I can use strrchr() for a period to get the pointer to the period just before file type. Is there a build in string function that will just take the rest of the string from a certain point on forward in the string? I know it wouldn't be much work to make it myself, but I figured I would find out if it already existed before doing it.

View 9 Replies View Related

General :: Delete A Specific String In Vi?

Sep 16, 2009

How do i delete a specific string in vi? Suppose i want to delete only the instance "ing" occuring in a file through vi , how could i do this??

View 3 Replies View Related

General :: Remove Files That Contain A Specific String?

Feb 17, 2010

How can you remove files containing a specific string?I have...Code:find |grep 'string'This may return several results and I wanted to rm the results.I also have...Code:ls -l |grep 'string'|awk '{print $9}'which also may return results.But point is, I can't supply the results as a parameter to rmI was thinking of looping but I don't know how to access the results as if they were an array or something.

View 5 Replies View Related

General :: How To Find A File With Specific String Inside It

May 7, 2010

Is there any way i can find a file with specific word inside it.For example if i want to find a file which has some text written inside it.How would i form a command to search them?

View 5 Replies View Related

General :: Searching A Specific Directory For Files Containing A Text String?

Nov 20, 2010

I am a member of a group which has written a program whose source code is being held in a specific directory (~cs252/Assignments/basicAsst/project) and we want to go through and change the parameters for the function "sequentialInsert." My job is to find all occurances of the function call to "sequentialInsert" and to also list the files from where the code came from. Also, I have to be in the commandsAsst directory when I do this. I have tried grep and find combined together, and I am at a lost.

View 1 Replies View Related

Fedora :: F13 - Make Location/address Bar In Nautilus Look Like A String?

May 31, 2010

In Fedora 12/11 there used to be a button in the Nautilus to the left of the address/location bar which would let me switch between two representation of location bar: 1) buttons 2) as string that I can type in.

In Fedora 13 I cannot get the same behaviour. The button is missing and location only shows up as a set of buttons.

I have looked in the settings of Nautilus, but couldn't find anything related to this. How do I get location bar to show up as a string where I can manually type the path?

View 3 Replies View Related

Programming :: Need To Delete A Specific String

Aug 27, 2010

These must a be a question you received a lot, but I couldn't find a similar thread! It's a simple question.
I need to delete a specific string from a file. For example the specific numbers "3456" from a file. I've tried with the tr comand, using
Code:
tr -d '3456' file,
but it also deleted whichever ocurrence of 3,4,5,6 from my file. Should I use a regular expression?

View 7 Replies View Related

Ubuntu :: Specific Location For Installed Programs?

Jan 9, 2011

Yesterday, I downloaded qt and gcc by using "synaptic package manager" tool.Where does those programs intstalled?Well, in windows the programs are installed in c:Program Files folder. Similarly, is there a specific folder that the newly installed programs are placed?

View 4 Replies View Related

Programming :: Write A Value From A Specific Memory Location In C?

Jul 13, 2010

How to write a value to a specific memory location in C language and how to access the same value ?
I am trying the same on fedora linux and i am trying to write the value to the 32-bit address.

View 2 Replies View Related

Fedora :: Adding String To File (a Specific Place) From CLI?

Jun 2, 2010

I have a script that among other things generates a makefile with an error that causes make to fail. specifically, the string "-Wimplicit-function-dec" should be changed a bit to "-Wimplicit-function-declaration". Is there a way to have bash add the new eight characters in the right place (on line 105)?

View 2 Replies View Related

Programming :: Append Variable String In A Specific Line?

Jun 8, 2010

I want to append a variable string to the end of a specific line. not like append the same string to each line. like in my file i have 4 columns, i want to add a string in 5th column in some fixed row.

View 4 Replies View Related

Programming :: Use AWK To Search For A Specific String Inside Html?

Jan 26, 2010

how to search for a specific string of text inside an html document. I then want to cut out that specific data that the field or string contains. I want to do a shellscript that makes this function automaticly.

For example:

#
#Here i want to find the field "town" inside the html/java and then cut #out the town name from it and paste that to an file.
#
#

[Code].....

View 8 Replies View Related

Ubuntu :: Bash Script To Delete/replace A Specific String Of Text?

Jun 17, 2010

What i want to do is pretty simple.I want to uncomment every line that begins with "deb" (except for deb cdrom) in /etc/apt/sources.list.I know how to do this through system > administration > software sources.I know I can gksu gedit /etc/apt/sources.list.I'd rather not do it that way.I'd rather have a script do it. It's less work, less typing, less clicking, and would work the same on every ubuntu version.

View 8 Replies View Related

Programming :: Copy String A To String B And Change String B With Toupper() And Count The Chars?

Oct 22, 2010

copy string a to string b and change string b with toupper() and count the chars

View 3 Replies View Related

General :: Compile Gvim From Sources?

May 25, 2011

Recently, I've installed vim like so:

hg clone https://vim.googlecode.com/hg/ vim
cd vim
sudo ./configure --enable-rubyinterp=yes --enable-pythoninterp=yes --enable-gui=gtk2 --prefix=/opt/vim
make
make install
make install clean

So, my VIM's binaries now live under /opt/vim/bin. Here is ls -la of this dir:

[Code]...

View 2 Replies View Related

General :: How To Always Start Gvim Maximized

Sep 13, 2011

set lines=999 columns=999

doesn't work, and

au GUIEnter * simalt ~x

only works for Windows.

View 2 Replies View Related

General :: Replace String With Empty String Of Dir Path ?

Apr 2, 2011

I want to replace a string of directory path in a string to empty:

Code:

But this doesnt seem to give me the desired thing:

Code:

This gives the desired outcome, but its specific, i need a variable in the sed not a string. And if I replace STRING="/mnt/sda1/record/$dd/" then I cant use it for something else, cause its has all the weird backslashes now.

View 3 Replies View Related

General :: Setting Background Color In Gvim?

May 16, 2010

I use a terminal with white text on black background (I just like it better), so I wrote the following line in my .vimrc file: set background=dark

However, gvim has black on white text. How do I do either of the following: Set the background of gvim to black Check in .vimrc if I'm using gvim I tried this: I started up gvim, and typed echo &term. The answer was "builtin_gui". So I wrote the following into .vimrc:

if &term == "builtin_gui"
set background=light
else
set background=dark
endif

Somehow, it didn't work.

View 1 Replies View Related

General :: GVim Via SSH -X Does Not Copy Paste On Selection

Nov 12, 2010

I'm using SSH (with -X specified) from a Ubuntu box to a RHEL4 box and running GVim. It opens as expected in my local X, but the copy and paste via select doesn't work. I cannot select text in GVim and paste in a local window, nor can I select text from a local window and paste in GVim. This works, however, when I SSH (with -X specified) to a different RHEL4 box. Is there something I need to install on the remote machine? I am running Parcellite 0.9.2 on the local box, but closing it doesn't make the problem go away, and it is not interfering with the other box.

View 1 Replies View Related

General :: GVIM Hangs When Saving Through GVFS' FTP

May 8, 2011

I loved Gnome's Nautilus and FTP integration and being able to mount a remote FTP directory as a regular bookmark/directory, and double clicking any remote files to open in any unmodified program. I also loved editing text files with GVim.

However, if I double clicked file on Nautilus to open a text file in Gvim, then saving a file will take about 10 seconds and GVim will hang for that amount of time. The major irritant is that I cannot continue editing while the text editor is waiting for the write to finish, this delay interrupted my workflow and thought process and saving becomes a painful process. The other problem is that I don't think simply uploading a file should take that much time.

I'm aware of GVim's internal FTP support, but they are not as well integrated with Nautilus's FTP and it suffers from the same problem.

So a few question:

Is there a way to make GVim or GVFS to save in background while I continue editing?
Why is GVFS so slow? Is there any way to set GVFS to use a single persistent FTP connection instead of creating a new FTP connection each time?

I'm on Gentoo Linux x86-64.

View 1 Replies View Related

General :: Extract A String Within A String Using A Pattern?

Nov 4, 2010

i have a file name using the following pattern:

PREFIX: AR
SOURCE: LEGACY
DATETIME: YYYYMMDD_HH24MISS
SUFFIX: .txt

sample filename:AR_LEGACY_20101104_105500.txti want to extract the source which is LEGACY in this case. how do i do this using shell?

View 1 Replies View Related

Software :: Check The Contents Of A Text File For A Specific String And Remove It From The File From The Command Prompt?

Oct 14, 2010

I want to be able to check the contents of a text file for a specific string and remove it from the file from the command prompt. I would basically be searching through a number of files and if a specific string is found I would like it removed automatically. pretty much a find and replace, were the replace is nothing. any one got any ideas on how you would do this. I already have the search part sorted just need to be able to remove the string I don't want from the multiple files.

View 4 Replies View Related

General :: Run A Headless Gvim To Get Syntax Highlighted Code Converted To HTML?

Jul 25, 2011

I want to generate HTML files in batch to show some gvim colorschemes in action. I took my current solution from the script at but this will open open a gvim window for each colorscheme I want to process. So far, the only way I have found to avoid the annoying new windows that pop up every second is to start a VNCserver and set the DISPLAY environment variable to that of the VNCserver so that all gvim windows are sent to the display within the VNC session.However, I would like to know if there is a way I can avoid the whole VNC setup and just run a headless gvim instance that does the conversion and exits, with no windows ever being actually displayed.

View 1 Replies View Related

General :: Change A Specific Characters To Capital In A Specific Text?

Dec 2, 2010

for example

else {
for fileDOC in $location/*.doc
do

[code]...

View 12 Replies View Related

General :: Error - Can't Open Display - For Xclock Or Gvim On Kubuntu Root Shell Konsole 1.6.6

Oct 8, 2009

I use kubuntu (8.04) which does not have a root account.

[sudo] password for ts:

However, starting xclock or gvim on root shell on konsole has the "Can't open display" error appears.

Error: Can't open display: localhost:0.0

Press ENTER or type command to continue

View 2 Replies View Related

General :: Awk Gsub() Command - String (column) Manipulation - Replace The Value Of The $1 Column In The Awk Print String?

Mar 7, 2010

i use this script to get the time and date of back and fourth transactions for a particular execution id. I use a substr command on the 5th column to to cut the milli seconds off the time value. - otherwise the times would look like 08:30:04.235

grep <executionID> <auditfile> | awk '{ print $1, $2, $3, $4, substr($5,1,8}
FIX -> Mon 3/1/2010 08:30:04
FIX <- Mon 3/1/2010 08:32:36
FIX <- Mon 3/1/2010 08:35:08

[code].....

anyhow - i append two sed commands to further clarify the direction of the message.

awk '{ print $1, $2, $3, $4, substr($5,1,8} | sed -e 's/->/ ->IN/g' | sed -e 's/<-/<-OUT/g'
FIX -> IN Mon 3/1/2010 08:30:04
FIX <- OUT Mon 3/1/2010 08:32:36

[code]....

I tried using an awk gsub () command within the string instead of the two seds, but it did not work:

awk '{ print gsub(/<regex>/, <replace with>,$1), $2, $3, $4, substr($5,1,8}

the sed works ok, but it would be cooler to make the replacement within the awk command:

gsub(/->/,-> IN, $1)

Is there a way where i could replace the value of the $1 column in the awk print string?

View 1 Replies View Related

General :: String Replace In Filenames - Files Already Contain The String "Soundtrack"

Jun 11, 2011

Moving right along, I have a folder of MP3 files containing various Movie sound tracks and scores. I'm using Audio Tag Tool to tag all the files at once with an "Artist" of "Soundtrack", and to inherit the "Title" tag from the file name. After that, I will rename all the files (Using Audio Tag Tool -- awesome program, btw) with the format "<Artist> - <Title>.mp3"

The problem, is many of my files already contain the string "Soundtrack", which would be redundant. I happen to be a perfectionist, so I'm unable to ignore it and move on. Hence my question to you fine folk: I want to delete all instances of "soundtrack" (-i case irrelevant) in the filenames before I go through the above steps. But, its not quite that simple. This is a sample of some of the file names:

[Code]....

View 3 Replies View Related

General :: Run A Program For A Specific Amount Of Time Starting At A Specific Time?

May 18, 2010

I want to record an internet radio station starting at 2:00am tomorrow morning. The specific program on the radio station lasts until 6:00am. The command I need to run to record the station is: Code:mplayer http://wjcu.jcu.edu:8001/listen.pls -ao pcm:file=indie_heat_of_the_night.wav -vc dummy -vo nullI'd use cron, but 1. I'm not sure how to and 2. it seems unnecessarily complicated for something that I only want to run once. If cron is the only/easiest solution, I guess I'll just have to resort to that, but I'd rather not.

View 12 Replies View Related

Ubuntu :: OpenMotif : Create Network Location Link As Local Filesystem Location?

Apr 26, 2011

I'm working with a program that uses Open Motif to create all of the widgets, including the Open File dialog box (obviously). However, Open Motif being kinda old-timey, 80's vintage, and for the most part now an abandoned project, it is quite clunky. So, actually what I need to do is to open some files located on my work server. I have already successfully connected to the relevant server directories with Samba, and with programs built with GTK+ (such as GIMP) I can open files across the network because I have created a bookmark in Nautilus, and those bookmarks appear in the Open File dialog box created by GTK+. Now, Open Motif is different: it doesn't see network locations, orNautilus shortcuts. When I type "smb://serveripyadayada" in the search folder, it really doesn't like it and complains. So, what do I do? Can I get somehow Open Motif to open a network location? Or can I do a run-around and place a shortcut in the file system that points to the network location?

View 2 Replies View Related







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