General :: Change All Number 10 In A Text File To Word Form?
Mar 20, 2011
I need to change all number 10 in a text file to word form, or in short from 10->ten. the thing is number 10 including in dates such as 10/22/1997 or 03-10-2011 should not be changed. im having some trouble because the file contains numbers like "price range from 10-50k".
this is just a sample.
name: john smith
date hired: 05/10/2010
expected salary: 10-50k
typing speed: 10 wpm
Using sed command is it possible to change like this..
I have a text file that contains a single word and I want to write a bash script that will read the word from the text file... The following is my incorrect attempt, as it assigns the name of the textfile to the variable as opposed to the word stored within the textfile:(assume I have a text file value.txt that has its contents a single word, say wordone)
Code: #!/bin/sh for f in value.txt do echo $f done
so the output of the above script is value.txt, however I want it to be wordone.to summarise: how do I assign the value of the word contained within a textfile to a variable?
I'm trying to isolate a number from a text file using sed. The text file looks like this:
-GARBAGE-GARBAGE-GARBAGE- Number of frames: 183933 frames Codec -GARBAGE-GARBAGE-GARBAGE-
I tried the following:
Code: sed "s/^.*Number of frames: //g; s/ frames Codec.*$//g" "info.txt" > "frames.txt" Strangely, it only seems to be stripping off the end, but not the beginning, like so: -GARBAGE-GARBAGE-GARBAGE- Number of frames: 183933
I'm obviously not using the command correctly, so what am I doing wrong?
I have on my windows machine several hundred files that are a format of .nc .ncs for a CNC machine. I need to convert them to txt which is something as easy as opening in notepad and then saving as .txt but there are so many that this kind of action would take way too long.
The reason I am writing the linuxquestions is because I would feel more comfortable in loading a live CD and using some sort of terminal command to do this than I would to download one of the many "freeware" type programs I have found for windows (even more so since I have had a root kit before and had to start all the way over to get rid of it).
I need to know:
1. Is this possible to do with the terminal without super advanced knowledge.
2. Can one please point me in the right direction; something to read or an example
Using the latest version of Ubuntu desktop on an emachine t5062 if it matters. I have a text file of keywords that is one-three words line after line for like 5000 lines. How would I go about adding a word to each line.Aside from typing it in or copying and pasting.If it can`t be done with Gedit I am all for using another program.
I need to chop of the top 30ish lines of several log files until a line starting with "Initialization completed."The trouble is that it's not always the same amount of lines that need to be deleted, and they don't always contain the same information, which is why I would need to delete everything priorhe line starting with "Initialization completed."Right now I have a little script I wrote based on looping each file through several "grep -v" commands with each known pattern of lines I want to ignore, but it is tedious and I have to inspect each file afterwards to make sure nothing is left from above "Initialization completed
I am trying to replace the first number in a string at the end of the line with the word that matches that number. for example i want to replace 546215 to be five-46215. The command that I have tried is
i have a file thunderbird which size 1.57GB, that files contain the email that had been deleted but fortunately not been compact so i still can retrive the email that had been deleted the problem the superior not give me the specific of the subject or date on the file.
X-Mozilla-Status: 0001(this number sometimes not same) X-Mozilla-Status2: 0000080(this number sometimes not same)
what i need is change the contain number 0001 to 0 in X-Mozilla-Status not the X-Mozilla-Status2, is there any way to do, and the file contain so much text like that so i want to change automatically.
I'm not a newbie to Linux, but I'm a newbie to LQ. I've searched the internet for an answer to an issue I'm having with JOE, to no avail.For my editing purposes, I HATE word wrap. I've read the man page extensively and nothing I try works.
To disable word wrap, it says, simply edit the joerc file and place --wordrap in the first column. Done. It works for .pl, and it works for .c (seems to be built in for C). Bottom line, I cannot disable word wrap for all text files, or at least the ones I want to edit. Has anyone solved this?
I need to create a script to count the number of lines from a text file . The output must be put on another text file (no_lines.txt) and in this file i need to generate from the script this output :"File $FILE has $NO_LINES lines ".
Want to search for ~ and delete it as well as to append the entire line to the above line. For Ex:
1111xxxx date Sandy area is ~around this area.3222xxx date There seems to ~left side of map, the colours are accurate (showing green areas)Even if I ~zoom in, the green parks, xxx3258 date The dammed up ~away, the "other" body of water varies ~blackNatural gas leaching.
IT MUST LOOK LIKE:
1111xxxx date Sandy area is around this area. 3222xxx date There seems to left side of map, the colours are accurate (showing green areas)Even if I zoom in, the green parks, xxx3258 date The dammed up away, the "other" body of water varies blackNatural gas leaching.
how to work properly on the windows forms application in c++.
the thing is that i was able to produce in the windows forms application a web browser and I added a save button. So know I am able to navigate predeclared webpages such as [URL]and then I entered google's search box such as "spread of H1N1". and I surf a page such as [URL] I later save the page as text file on my computer.
I wanted to know how to organize the words in the text file ? i mean how can i just get the number of infected people in USA , number of infected in CANADA (if they exist) from all the text file and change it to a file with precise data.that is to eliminate the unneeded information such as the the characteristics and the useless ideas? and what if i also wanted to know the characteristics of the virus in a country+the number of infected?. How can i do it?
I want to be able to find the lines that matches my input and change the N to a Y, but only for the lines that matches the name and not any other N's My problem is the line does not always contain a P as it can be a D as well so my matching did not work. If my script issues the name $1=triva the lines will change to:
I have the following code so far but as you can see it does not change the D's
sed -i 's/trivia:P:Y/trivia:P:N/g' servers.txt
*** UPDATE ***
should I be using a method as follows? I am still stuck on the changing all instances though.
$1=server sed -i 's/$server1:P:Y/$server:P:N/g' server.txt sed -i 's/$server1:D:Y/$server:D:N/g' server.txt
In formsweb.cfg file are two lines with labels archive_jini= and archive= at the beginning of line. After equal sign (=) is row of filenames of java archives delimited by coma(,). When I insert a new jar file in java directory, I have to append the very same name of jar file to both lines if that name is not yet present.
When I try to view my home folder (for instance), I press the icon on the left of my name (/home/...) and it doesn't do what I accustomed to which is to show the text form of the directory. Is this a bug or am I missing something?
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).
I'm using bash under Ubuntu.Currently this works well for the current directory:catdoc *.doc | grep "specificword" But I have lots of subdirectories with .doc files.How can I search for, let's say, "specificword" recursively?