General :: Replacing A Numeric String With A Sequence Of Numbers?

Jun 21, 2009

I have a text file with content that look like this..

Code:
1,3927,"AIS"
1,6928,"AIS"

[code]...

View 13 Replies


ADVERTISEMENT

General :: Replace Sequential Numbers In A File With A Different Sequence Using Sed?

Apr 11, 2010

I am trying to find a way to replace a set of sequential numbers in a file with a different sequence using sed. This might be done easier using awk or some sort of bash script, but it seems to me there must be a way to do this easily with sed. Basically, what I am editing is a Cisco switch config. I want to change the sequence of ports to a different numbered sequence. Here is an example of what I am trying to do.I want to change for example, the file:

Code:
cat testfile
interface FastEthernet0/1

[code]...

View 6 Replies View Related

General :: Replacing Dot In String But Leaving Last One?

Jan 17, 2011

Possible Duplicate: replacing dot in string, but leaving last one replace the "." [dots], but leave the last one: e.g.: .txt [there could be random number of dots in the string, even zero, i just need the last one]

$ echo 'someth.ing.something.txt' | SOMEMAGIC
someth-ing-something.txt
$

View 1 Replies View Related

OpenSUSE Hardware :: Numeric Keyboard Always Stay In Numbers Off Mode

Jul 24, 2010

My numeric keypad is always in "Numbers off" mode even though the Num Lock light is lit up. I am using 11.3 and have a Microsoft Natural Ergonomic keyboard 4000.

View 2 Replies View Related

General :: Perl Chop Numbers Off Os A String - Leave Letters

Aug 12, 2010

I am trying to strip the numbers from the 5th columns and just get letters - in perl - i tried using subsrt, chop. and a regex -

what i want to get is:

i tired appending a regex perl -nle 'print /(w{1,20})d{1-20} but it did not work.

View 5 Replies View Related

Programming :: Generating Series Of Numbers Of Sequence?

Mar 19, 2011

I am trying to generate sequence of number in the order of :

1
2
3
4

[Code]....

View 7 Replies View Related

Programming :: SQL -any Value For Numeric Or String Field?

Feb 12, 2010

how do i ask in a query for any numeric or string field? It may not have any meaning, but i need it to fill a toplink DataReadQuery in java....Something like " select * from table where table.fieldA='?'

View 2 Replies View Related

Programming :: Replacing Numbers In Bash Scripts?

May 25, 2010

I have lines in some files that look exactly as below, and the line numbers they occur in are always the same. (Lines 136-139)

W 0.00000000 0.00000000 2.00000000
W 0.50000000 0.50000000 2.50000000
W 0.00000000 0.00000000 3.00000000

[code]...

View 1 Replies View Related

Programming :: Bash Thinks String Variable Is A Numeric One

Jul 7, 2011

Bash 3.1.7

Code:

Code:

Code:

I think read A1 A2 makes A1, A2 string variables. Then, when A2 gets the value 01, '01' should be a string. But for some reason bash takes it as numeric. I know there are no types in bash.

View 11 Replies View Related

Ubuntu :: Broken Boot Sequence After Replacing An NVidia 6600GT With A Radeon X1300

Apr 27, 2011

Yesterday, after my nVidia 6600GT left its last breath I had to revive somehow my Ubuntu box. So I used the next available card I had at my disposal, a Radeon X1300/1550 (RV516).What I have done so far:

1. Using 2.6.35-48 generic (recovery) bootup, I managed to fire up the failsafeX.

2. I used this guide to purge Nvidia leftovers.

3. I used this RadeonDriver guide to install the OpenSource Radeon driver.

When I try to boot using the normal choice on GRUB (kernel2.6.35-28-generic) , all I get is a console (no X).Right now I am running X through Recovery boot, and my lsmod shows this:

Code:

Module Size Used by
nls_utf8 1069 1
isofs 30022 1

[code]....

View 2 Replies View Related

Programming :: Replacing String Using Awk?

Jan 19, 2010

i have a string of information displayed in this way :

Code:
John:king:20:34:60
what i am tring to do is to read in input which is given by the user and change it to the

[code]....

View 3 Replies View Related

Programming :: Converting String Sequence Of 1's And 0's Into Their Hexa Sequences

Apr 27, 2011

I have to write a code that converts a sequence of 1's and 0's(block) into their equivalent hexa number and copying to another array(byte). but this sequence is not always of length 8 and you are required to send strlen(sequence)%8 bits back into the string. So i've written down this code and it works well with the sample input but fails in the real program.

Code:
int Convert_encode( char * block,unsigned char * byte)
{
int len,iter,i,j,k,sum;
char * temp=(char *)malloc(4*sizeof(char));
len=strlen(block)/8;

[code]....

View 7 Replies View Related

General :: Replacing A String In A File With The Contents Of Another File?

Jun 15, 2010

I would like to know how I can replace a string in one file with the complete contents of another life.

View 10 Replies View Related

Software :: Filter Command For Replacing A String In A Folder?

Mar 5, 2010

I am having a folder which is having 155 files, i have replace a string with a different string.How can i do it?

View 1 Replies View Related

Programming :: Replacing A String Of Text That Includes "/"

Sep 29, 2010

Suppose I have a file named temp.txt

cat temp.txt
word/one/two/three

If I would like to replace "one" with "six" I would do this:

cat temp.txt | sed 's/one/six/'
word/six/two/three

Now I want to replace "one/two" with "six/seven" and these options don't work:
cat temp.txt | sed 's/one/two/six/seven/' (OFCOURSE)
cat temp.txt | sed 's/"one/two"/"six/seven"/'

I even want to be able to replace "one/two" with "six/seven/eight"

View 6 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 :: 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 :: 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

Programming :: Create Inverted Files To Associate Files To Numbers ( Numbers Being The Index Of My Paths )?

Apr 4, 2011

am writing a small search program for my class. I have decided to use indexing for my program. Ive researched online about indexing and how search engines do it. If im gonno do that I need to create inverted files to associate files to numbers ( numbers being the index of my paths ) . Now I was wondering what would be the best way to create an inverted file ? I was going to create sql tables using mysql api in C but then again there is no array data type or vectors to store few numbers in a single column in mysql and it is not advised to use Enum or SET

View 14 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 :: Why Is The Boot Sequence Organized The Way It Is

Jan 6, 2011

Why is the Linux boot sequence is organized the way it is?Power on + BIOS runs hardware initialisation and self tests, LILO/GRUB etc... but why is it organised the way it is?Would I be right saying it is primarily for debugging purposes?

View 1 Replies View Related

General :: Startup Sequence Without Login?

Jun 11, 2011

I have an embedded box on which I am developping a driver using a linux kernel. I frequently need to reboot it and relogin as root.

I wounder whether I can modify the boot sequence so that it directly boots into a bash belonging to user 'root'.

I know that this represents a security issue -- looking at my "use case" this is of concern.

View 6 Replies View Related

General :: Vim: An Equivalent Two-keystroke Sequence For The <Esc> Key

Jun 24, 2011

The <Esc> key has an equivalent two-keystroke sequence within vim, I think I remember.

View 8 Replies View Related

General :: Possible To Interrupt The Boot Sequence?

Apr 30, 2010

Is there a way to interrupt the boot sequence, or execute it line by line? Alternatively, after a command has executed and the scree fills up, is there any way to "page up" on the screen?

View 1 Replies View Related

General :: Change Startup Script Sequence?

Sep 18, 2010

I have an external drive mounted courtesy of an entry in fstab. The drive isn't detected at boot time until AFTER the backuppc service that will use the drive has started. I have to therefore manually stop and restart the backuppc service once booting has completed, otherwise backuppc thinks there is no drive available to it.

How can I force the mounting of my external device to occur BEFORE the backuppc service starts?

I am using Ubuntu 10.04 server edition

View 2 Replies View Related

General :: Unable To Use Chicken-Egg In Booting Sequence

Jul 13, 2010

chicken-Egg problem in booting sequence.......

View 6 Replies View Related

General :: Doing A Sequence Of Commands In A Bash Script?

Dec 2, 2010

I'm creating a bash script that contains the following line:"ssh user@$server1 cd /tmp; pwd"What I want is to print /tmp of server1, but the script it isn't printing that

View 2 Replies View Related

General :: Finding And Deleting A Sequence Of Letters ?

Dec 6, 2010

I'm trying to write a script to do the following:

I have a text file that contains many lines that look like this:

I'm trying to make my script read this text file, find the string sequence "QIEN", and delete everything from this sequence backwards (including "QIEN") so that the above lines look something like this:

I'm aware that grep is good to do a regular find-and-delete as follows:

Code:

But this will delete everything on the lines that contain the string sequence "QIEN".

View 3 Replies View Related

General :: Sequence Of Partitions / Mount Points?

Mar 1, 2011

figure out the best partition layout for my linux installation which I'm about to have on my laptop. Having read numerous articles on partitioning in linux I've gathered some ideas, still there was no let's say a clear explanation as to the sequence the mount points should be arranged on the disc...What I have in mind is to use a single disc space as efficiently as possible considering the head travel. The pc is a laptop, 160GB HDD and will be used as a normal desktop with some simple sound processing. Distro Linux Mint 10. I'm planning to have such partitions and all will come after a Win7 installation:

/boot -> some write it's not necessary in dual-booting, some that it's good to have for security
swap -> with 4GB of RAM i don't suppose i'll use it
/

[code]....

have the most heavily utilised partitions close to each other so the head doesn't move for large distances. The placement also makes a difference as the closer to the inner rim of the disc the worse performance. I'm also not sure about the sizes. Read posts with recommendations but still judging by installations on a different laptop and virtual machine e.g. 5GB for /opt is a bit too much as there's almost nothing in there. Certainly /usr fills up, /var too from what I've observed. / also has scarce data in it so I'm wondering if giving them e.g. 5 gigs each won't be a waste of space resulting in greater head travel.

View 10 Replies View Related







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