Sponsored Content
Top Forums Shell Programming and Scripting Help with Sed or AWK command!!! Post 302111771 by kumarsaravana_s on Thursday 22nd of March 2007 02:21:55 PM
Old 03-22-2007
Quote:
Originally Posted by cfajohnson

I would use tr, not sed or awk:
Code:
tr -d '0-9' < FILE > new.txt

Hi Johnson,

The tr command seems to only remove the 0 and 9

instead of getting output like aa.xml....i'm getting...aa_1285_52.xml..

i tried like this

tr -d '_0123456789' < FILE > new.txt

and the above command is able to remove everything mentioned between quotes...

Thanks for ur command...
Kumar
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

What do you know about the Sed and Awk command??

I just need some information on what they can be use for and whatever else there is. anything you know, state here (2 Replies)
Discussion started by: TRUEST
2 Replies

2. Shell Programming and Scripting

sed for this awk command

Hi what would be the sed equivalent of this awk command: awk '/$getsn/{getline;next}{print}' file It deletes the variable found and the next line after it in a file. Thanks (3 Replies)
Discussion started by: wisher115
3 Replies

3. Shell Programming and Scripting

awk/sed Command : Parse parameter file / send the lines to the ksh export command

Sorry for the duplicate thread this one is similar to the one in https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121 Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
Discussion started by: rajan_san
4 Replies

4. Shell Programming and Scripting

Interpret sed and awk in the below command.

Could you interpret the following sed and awk command for me? command: cat tempfile2 |sed "s/\(BUILD-3-.*-\.-\)\(.*\..*\..*\)/\2/" | awk '{printf "%-8.8s %-23.23s %-30.30s %-50.50s\n", $1,$2,$3,substr($0,index($0,$4))}' > outfile2 2>/dev/null input:data in tempfile2... (5 Replies)
Discussion started by: vj8436
5 Replies

5. Shell Programming and Scripting

SED/AWK command

Hi All, I have a file which has following lines : - Deploy XXX application <server-address> - info <server-address> - Deploy XXX application <server-address> - info <server-address> - Deploy XXX application <server-address> - info <server-address> I want output like this way in... (8 Replies)
Discussion started by: bhaskar_m
8 Replies

6. Shell Programming and Scripting

Command line - awk, sed

My input file gfile values is CTRY=GM&PROJTYPE=SP&PROJECTTYPE=Small+Project If i am giving PROJECTTYPE then it must give Small Project awk -F"&" '{for (i=1; i<=NF; i++) if ($i ~ "^"PAT) {sub ("^"PAT"=", "", $i); sed 's/'+'/""/' $i ; print $i }}' PAT=$1 ... (6 Replies)
Discussion started by: nag_sathi
6 Replies

7. Shell Programming and Scripting

sed and awk giving error ./sample.sh: line 13: sed: command not found

Hi, I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :- ./sample.sh: line... (12 Replies)
Discussion started by: satishmallidi
12 Replies

8. Shell Programming and Scripting

Need help with sed/awk command

Dear ALL, I am still struggling with some basic sed operations. I want to change path in a file as shown below: case_OM = PV4Reader( FileName='/home/linuxUser/demoCases/s1/case/case.OM' ) to case_OM = PV4Reader( FileName='/home/linuxUser/demoCases/s2/case/case.OM' ) In this file there... (5 Replies)
Discussion started by: linuxUser_
5 Replies

9. Shell Programming and Scripting

Need help with sed/awk command

Dear all, I have a file named as fileName with following entities, functions { planeDictName { type surfaces; functionObjectLibs ( "libsampling.so" ); outputControl timeStep; surfaceFormat vtk; fields ( p U ); ... (42 Replies)
Discussion started by: linuxUser_
42 Replies

10. Shell Programming and Scripting

Help with sed/awk command

Hi All, This is my first thread. Hopefully you guys can help me out. I have a csv file, that provides access to managers to a tool. The file is loaded onto our server containing all the assc id's with a trailing comma. For ex: 182950, 123456, However, we receive a file that... (8 Replies)
Discussion started by: Prateek Dubey
8 Replies
HODIE(1)							   User Manuals 							  HODIE(1)

NAME
hodie - Print current date and time... in Latin SYNOPSIS
hodie [ OPTION ]... DESCRIPTION
hodie prints out the current date using classic Latin, and in addition also prints it out and time using Roman numerals. OPTIONS
-h, --help Print short help message with syntax -v, --verbose Print months and days (pridie, Kalends, Nones, Ides) full and not the respective abbreviations (standard mode of operation) Two occurrences of -v as well as the use of -vv or --extremely-verbose will include the numerals where applicable fully declined, as in 'ante diem quintum Kalends Septembres'. -n, --numerals Don't print anything in Latin - only the date and time as Roman numerals. -x, --force-numerals Print both the verbose latin and the date and time as Roman numerals. -c, --classic, --auc Print the year in the classic manner ab urbe condita instead of the more modern anno domini . -a, --ante-diem Print the date expressing the number of days to the next main day with the ante diem expression instead of ablative case. -d, --date Print out any date. This has a rather special syntax, with a keyword following the -d flag choosing input format. See section on DATE INPUT below. -r, --republican OFFSET Print out the date dated ab urbe tua condita with the offset counted in years as compared to the modern european kalendar (originat- ing with the hypothetical birth of christ). hodie -r -753 would be equivalent with hodie -c --version Print out the version number of this release and exit. No matter whether other options appear on the command line or not. DATE INPUT
Following the -d or the --date option flags, the first item must be one of the following: verbose In this case, the year, month and day are given by following the verbose keyword by the flags -y, --year, -m, --month, -d, --day for year, month and date respectively ymd After this flag, the date comes in the format YYYY-MM-DD , where the numbers may be separated by any non-numeric character. dmy With this flag, the date is given as DD-MM-YYYY mdy With this flag, the date is given as MM-DD-YYYY Restrictions on the characters that may replace the hyphen apply as above. HISTORY
The story began on the 10. of August, 2000 (a.d. VI Id. Iul., MM). Having finished most of my assignment for my two-month summer job at Ericsson Eurolab Deutschland, Nuremberg, I was idling around on the Internet, and stumbled over the dotcomma-challenges <http://www.dot- comma.org> , where especially the Roman numeral challenge started my mind. Almost an hour hacking, and there it was, another hour, and the language support was there. Before the night was over, I had written this man page and had the layout of a decent Makefile drawn out mentally. At the end of the next day, I was so far that I actually had the workings of RPM worked out, constructed a .rpm-package and a .src.rpm- package, which was promptly released on my home-page, announced on freshmeat and uploaded to metalab (apps/misc :-). Response was quick and plentiful. By now, I have compilation reports from Linux, FreeBSD and SCO Unixware 7; there are a few compability issues to put aside, but it works surprisingly well. RETURN VALUES
hodie returns zero. Always. If it doesn't, then something is really bad with the code. For some really unreadable code, this means that hodie could be used as a strange replacement for true BUGS
It doesn't sanity check the input... telling hodie to display the roman form of the 99th of march gives a slightly jumbled output, which most definitely does not make sense. Reports are more than welcome (e-mail below). AUTHOR
Now, who would come up with such a thing? Well, I'm Mikael Johansson, a rather all-round geek from Stockholm. I'm gravely interested in languages, in computers and in mathematics; a combination more dangerous than you might think. E-mails to <mikael@johanssons.org> SEE ALSO
date(1) Linux AUGUST 2000 HODIE(1)
All times are GMT -4. The time now is 09:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy