General :: Moving Characters To The End Of Line (EOL) With SED?
Sep 13, 2010
Any time the word The appears at the beginning of a line, I want to move it to the end of the line and capitalize the new first word in the line. For example, The heaven becomes Heaven the. I'm trying to test this out for my Library.
View 2 Replies
ADVERTISEMENT
Jan 8, 2010
I want to sort a number of lines based on their size:
data:
-------
12345678
87654321
1234
[code]....
Should output as:
-----------------
1
2
12
21
[code]....
But i'm gettings this with sort
----------------
1
12
123
1234
[code]....
Can we sort the above "data" text, based on "number of characters" instead of "character order"?
View 8 Replies
View Related
Nov 1, 2010
We have a list of cyclones in the world. Now i got to check whether or not the second field is more than 1000 mm. If so, than the line has to have a[*] at the end of the line. For exemple:
Australia:1411:55.55:Mackay Cyclone 1918:1918:Mackay
to
Australia:1411:55.55:Mackay Cyclone 1918:1918:Mackay[*]
I also have to use a substitute. So far i've got this but it fails, 6,$s/([0-9])111:1/.* [*]
View 7 Replies
View Related
Mar 23, 2011
I have a bunch of files (around 900) that have some special characters. Some of the files contains example, and quoting "[useless] filename (something)"so what I want is just to strip the brackets and parenthesis, some are folders, others are text files
View 1 Replies
View Related
May 3, 2011
I'm having trouble setting up PuTTY with Ubuntu. I'm trying to get line characters to work in aptitude as well as 256-color support, but can only get one or the other.
Ubuntu Config:
Using 64-bit Ubuntu
Terminal type xterm-256color or putty-256color gives 256-color, but incorrect line characters.
Terminal type linux gives proper lines in aptitude, but only 16 colors.
PuTTY Config:
Using font with Unicode characters. (DejaVu Sans Mono)
Received Data is assumed to be in UTF-8.
Set to use Unicode line drawing code points.
Output from locale:
View 1 Replies
View Related
Apr 23, 2010
I am playing with various characters in the command- line interface trying to learn what they mean and when i should use them.
View 7 Replies
View Related
Feb 6, 2011
I wish to replace a new line with br (html) but it doesn't seem to work
Code:
message=$(echo ${FORM_message} | tr '
' '<br />' )
what it gives me seems to be ... b...? I am also having problem escaping hash sign in cut command:
Code:
list=$(echo "$line" | cut -d'#;#' -f1) ;
my intention is to split the line with "#;#"
View 5 Replies
View Related
Jul 14, 2010
I've written myself a linux program "program" that does something with a regular expression. I want to call the program in the bash shell and pass that regular expression as a command line argument to the program(there are also other command line arguments). A typical regular expression looks like "[abc]_[x|y]".Unfortunately the characters [, ], and | are special characters in bash. Thus, calling "program [abc]_[x|y] anotheragument" doesn't work. Is there a way to pass the expression by using some sort of escape characters or quotation marks etc.?
(Calling program "[abc]_[x|y] anotheragument" isn't working either, because it interprets the two arguments as one.)
View 7 Replies
View Related
Jun 24, 2011
I've written myself a linux program "program" that does something with a regular expression. I want to call the program in the bash shell and pass that regular expression as a command line argument to the program (there are also other command line arguments). A typical regular expression looks like "[abc]_[x|y]". Unfortunately the characters [, ], and | are special characters in bash. Thus, calling "program [abc]_[x|y] anotheragument" doesn't work. Is there a way to pass the expression by using some sort of escape characters or quotation marks etc.? (Calling program "[abc]_[x|y] anotheragument" isn't working either, because it interprets the two arguments as one.)
View 8 Replies
View Related
Dec 23, 2010
I have a log file that contains information like this:
----------------------------
r11141 | prasath-palani | 2010-12-23 16:21:24 +0530 (Thu, 23 Dec 2010) | 1 line
Changed paths:
M /projects/
M /projects/
[code]....
what i need is, i need to copy the data given between the "---" to seperate files, for, e.g. the first set of data between the "---" should be in one file and another set of data in another file.
View 5 Replies
View Related
Oct 17, 2010
How can I move a directory to the root of a drive via command line?
In MS-DOS it would be 'move C:/GAMES/QUAKE C:/'
What is the equivilent in Linux?
View 8 Replies
View Related
Aug 28, 2011
While modifying the definition of my PS1, I saw that "[" and "]" markers should be added to help bash to compute the right display lenght. Many exemples on the web do not use them or even mention them.I searched for a solution to add them automatically, like with sed, but I didn't find any example.Are they still needed and is there a recommandation not to use sed to define PS1?
View 1 Replies
View Related
Jun 3, 2010
I'm having a bit of a headbanger trying to work this one out. I'm trying to remove all of the characters on a line apart from the last 17. For example, I need to change this:
Code:
00000000000000000089;0bbfaeb8
01000000000000000089;0bcb5948
00000000000000000089;0bcc4c40
[code]....
View 5 Replies
View Related
Dec 29, 2010
I would like to replace 'xxxx' with 'yyyy' which is in a file xyz.csproj not sure of what 'xxxx' is, it can be 3055, 4056, 7089 etc. I know it always appears at line # 5 and at character 50.
<Reference Include="System.Management" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Windows.Forms" />
[code]....
View 14 Replies
View Related
Dec 21, 2010
Probably an easy question but my googlefu is weak. How do I change the number of characters per line for konsole?
View 6 Replies
View Related
Jan 28, 2011
I'm having trouble getting a sed command to work. I need to filter a printed line to get characters between 2 expressions. "<job>" and "<url>".
Code:
echo "<job>TEST<url>http://www.project.com/?code=001" | sed 's/^[<job>]*//' | sed 's/[<url>]*$//'
Produces:
Code:
TEST<url>http://www.project.com/?code=001
It takes off the first part but why is that not deleting the "<url>" and all the parts after that?
View 9 Replies
View Related
Sep 26, 2010
On my terminal only system ( no Xorg or guis ) I have a font rendering issue. In place of some symbols ( eg double-lines and some other miscellaneous line-drawing shapes) are generic diamonds. Attached is a fbgrab ( png format ) of elinks showing the problem. I have now configured elinks to only use single lines drawing characters ( which work fine ) for now as a work around. Here is my /etc/default/console-setup
Code:
# Change to "yes" and setupcon will explain what is being doing
VERBOSE_OUTPUT="no"
# Setup these consoles. Most people do not need to change this.
ACTIVE_CONSOLES="/dev/tty[1-6]"
[code]....
The numbers in the FONTFACE show the size of the font matrix. For example Lat2-Terminus20x10.psf is a font for codeset Lat2 with size of the font matrix 10x20 (i.e. 10 columns and 20 rows). If the number of columns is 8 then only the number of rows is specified. For example the font matrix of Armenian-Fixed15.psf has size 8x15.
In text video mode or if you use the RadeonFB kernel module only fonts whose font matrix has 8 columns can be used (that is the size should be a simple NUMBER rather than a NUMBERxNUMBER combination). The other fonts can be used only with framebuffer video modes and with the package 'kbd'. The console package 'console-tools' can not be used
with such fonts.
THE TERMINUS FONT:
The aim of the Terminus font is to reduce the eyes-fatigue when one has to read a lot. Currently this font supports only the Latin, the Cyrillic and the Greek scripts (the Lat15, Lat2, Lat7, CyrAsia, CyrKoi, CyrSlav, Greek, Uni2 and Uni3 codesets). The fonts with font face TerminusBold and size 14 or 16 are optimized for 8 pixels width glyph matrix (in most cases this means framebuffer). The fonts with font face TerminusBoldVGA and size 14 or 16 are optimized for 9 pixels width glyph matrix and can not be used with
framebuffer video modes.
The fonts with font face Terminus and size 14 or 16 can be used both with 8 and 9 pixels width glyph matrix. In the regular text video modes the width of the glyph matrix is 9
pixels. If you use the package svgatextmode then the width is 8 or 9 pixels and you probably know it. The Terminus font in this version of console-setup is version 4.26.
View 7 Replies
View Related
Jan 22, 2009
When I move files with the mv command, it simply waits until the file has moved and then the command prompt appears again. This is fine, but there are two things which are rather annoyingThere is no progress bar: When moving really large files, you have no idea how long the move is going to take. Is there possible to produce a progress bar to show how much has finished? You can't do anything while you're moving: You can't use the command prompt while you're moving the file/files. I'm currently not using a Linux computer (I'm at school) but maybe it's possible to write mv <file> <location> &, I just thought of that just now. Is it maybe possible to use another program than mv to move you files?
View 2 Replies
View Related
Jan 26, 2011
I'm having issue when trying to change a line in a file
[Code]....
View 1 Replies
View Related
Jun 24, 2009
I upgraded in Ubuntu from 2.6.28-13 to 2.6.30 and now I get no line-drawing characters in applications like alsamixer; instead they are replaced by 127-bit chars like 'lqqk'. As a coder, I'd really like to understand what happened - what changed (file in /etc?) affecting terminal capabilities, and what does the kernel have to do with it .
PS: the distro is Jaunty and I used the debs at http://kernel.ubuntu.com/~kernel-mainline/:
Code:
linux-headers-2.6.30-020630_2.6.30-020630_all.deb
linux-headers-2.6.30-020630-generic_2.6.30-020630_i386.deb
linux-image-2.6.30-020630-generic_2.6.30-020630_i386.deb
View 2 Replies
View Related
Apr 12, 2011
I've been using the command line music player moc for some time now & am in love with it. So, I thought it'd be nice if I can add a current track info feed to my conky display. Therefore, I have this smple script that gets the track info from mocp -i .
Code:
#!/bin/sh
TITLE="`mocp -i | grep 'Title:' | sed -e 's/^.*: //'`";
if [ "$TITLE" != "" ]; then
ARTIST="`mocp -i | grep 'Artist:' | sed -e 's/^.*: //'`";
code....
But here comes the point. The way the track info is shown feels kind of blunt. I was wondering if something can be done either in the script or in conkyrc so that the track info is shown in a single line, moving backward at a constant speed; like you know, news channels show news strips at the bottom of the screen .
View 1 Replies
View Related
Jul 8, 2011
What command could I use in terminal to delete all ASCII characters? That is, delete a-z, A-Z, 0-9, and all punctuation? I have a file containing Chinese characters, and I want to remove everything else and leave just the Chinese.
I can use grep to leave only the lines that have Chinese in them, but this still leaves a lot of non-Chinese stuff on those lines. Does anyone know how I could actually remove everything that isn't Chinese?
View 4 Replies
View Related
Jun 16, 2010
I have my OpenSuse 11.1 box set up with utf-8, however, every time I try to open a file with utf-8 characters with vi it can't handle those characters properly.
View 6 Replies
View Related
Sep 13, 2009
I have installed fedora 11, now i want to install touch driver for my dell 15 laptop. when i m moving cursur its moving but when i m clcking on touch pad to open anything its not opening, to open i have 2 select any file then i have to click touchpad keys.
View 2 Replies
View Related
Mar 27, 2011
I like the buttons on the left. I'm running 10.04 & I know how to move them. The problem is that changing themes will move them back right. OK, if the new theme has them on the right that's OK. But going back to the other theme doesn't change them back. They don't seem to be controlled by the theme, or I'm just not doing it right.
View 2 Replies
View Related
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
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
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
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
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