Translating the same file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Translating the same file
# 1  
Old 11-15-2009
Translating the same file

I want to strip off '\032' character from a file using:

tr -d '\032' < oldfile > newfile

this outputs the contents of oldfile to newfile, but I wanna do that in the same file i.e. remove the \032 character from the old file. I tried:

tr -d '\032' < oldfile > oldfile

But the oldfile contents were lost. How to do that?

Thanks

Last edited by gagan8877; 11-15-2009 at 08:19 PM..
# 2  
Old 11-15-2009
Code:
tr -d '\032' < oldfile > newfile 
mv newfile oldfile

# 3  
Old 11-16-2009
Those are 2 cmds - I am trying to fit this in Datastage Cmd Exec Activity. I need 1 cmd with some kindda pipe or something. Is it possible to do that in one?
# 4  
Old 11-16-2009
Put the commands in a shell script and put the shell script in your "Datastage Cmd Exec Activity" (whatever that is).
 
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Portable way of translating epoch time

echo $(date +%s) | awk '{ print strftime("%c", $2"-"$3"-"$NF"/"$4); }' The above command only seems to work on newer versions of awk or systems with gawk installed. how can i translate the epoch time into a human readable format using a portable method? also, date -d@$epochtime does not... (3 Replies)
Discussion started by: SkySmart
3 Replies

2. Shell Programming and Scripting

Translating script to perl

awk/shell: UWARNING=90 UCRITICAL=97 PXNAME=$(echo $line | awk -F, '{print $1}') SVNAME=$(echo $line | awk -F, '{print $2}') FRUPERCENT=$(echo $line | awk -F, '{print ($5 / $7) * 100}') ... (6 Replies)
Discussion started by: SkySmart
6 Replies

3. Shell Programming and Scripting

Please help translating this to shell

Hello Im new here, I just got my first VPS and I really need help converting this .bat to shell script so i can run my program. @echo off @title DiamondMS v117 set CLASSPATH=.;dist\* java -client -Dnet.sf.odinms.wzpath=wz server.Start pause I have no idea what im doing to convert this... (12 Replies)
Discussion started by: valleric
12 Replies

4. UNIX for Dummies Questions & Answers

translating physical/virtual addresses

Hi all, I am new to Linux kernel/user space programming having been an assembly programmer in my previous life. I am now using 2.6.x kernel on an embedded CPU that has a few dedicated hardware blocks (including more CPU running just C-code, i.e., no operating system). There is a single DRAM... (1 Reply)
Discussion started by: agaurav
1 Replies

5. Shell Programming and Scripting

Translating/Replacing characters in a file

Hi, i have a given file named hugo.dat. In this file there are several lines that contain characters like } and ~ Now, i need a script that replaces the character } to ü and character ~ to ß Can anyone help for a working ksh script? Kind Regards FranzB (3 Replies)
Discussion started by: FranzB
3 Replies

6. UNIX for Advanced & Expert Users

translating device to filesystem in solaris10

Greetings, I have a oracle database server and i keep getting grid control message Metric=Disk Device Busy (%) Metric Value=98.66 Disk Device=ssd430 Severity=Critical Message=Disk Device ssd430 is 98.66% busy. so I am trying to correlate the ssd430 to the filesystem. I understand this... (3 Replies)
Discussion started by: p4cldba
3 Replies
Login or Register to Ask a Question