Hi,
I have a file with 40 columns out of which 15 are amount fields. There are approximately 6 mn records in this file.
The file has data in following format:
I need to take all amount fields and do some logic where the last digit of each amount field is changed to a character based on the digit value.
So amount fields from above line should be converted like this
00.468 --> 0046T
-00.456 --> 0045K
-00.23 --> 002L
780--> 78}
452 --> 45B
539 --> 53X
I was able to get the logic for converting one number at a time i.e I have coded a script which will take in a number and based on rules defined will give an output. e.g: if input to script id 780 it will give output 53X
What I need to know is how do I give this file as an input to my script, so that only the amount fields are changed and my output file format is maintained
Regards
Wah
Last edited by Yogesh Sawant; 06-11-2008 at 07:24 AM..
Hi,
Please find attached a file that has special characters on it. It is a copy and paste from a Micro$oft file.
I don't want to use strings as it remove all the 'indentations' / 'formatting' so I am replacing them with space instead.
I am using the sed command below
sed "s/$(printf... (1 Reply)
Suppose I have a file which has 1000 columns (5 SHOWN FOR EXAMPLE)
two alphabets are separated by a space and then tab
A A"\t"C C"\t"G G"\t"0 0"\t"T T
A G"\t"C C"\t"G G"\t"A T"\t"0 0
G A"\t"0 0"\t"G C"\t"A A"\t"T C
whenever there is a 0 0 in any column, the output should be printed as
A... (12 Replies)
Hi guys,
First off, i'm a complete noob to UNIX and LINUX so apologies if I don't understand the basics!
I have a file which contains a hex value of '0D' at the end of each line when I look at it in a hex viewer.
I need to change it so it contains a hex value of '0D0A0A'
I thought... (10 Replies)
* hdisk99 U5791.001.9920BZ4-P1-C05-T1-W500507630E060C14-L401140BA00000000 IBM MPIO FC 1750
* hdisk100 U5791.001.9920BZ4-P1-C05-T1-W500507630E060C14-L401140BB00000000 IBM MPIO FC 1750
* hdisk185 U5791.001.9920BZ4-P1-C05-T1-W500507630E060C14-L401140A000000000 IBM MPIO FC... (2 Replies)
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)
Hello all,
This is my first post here, so please excuse me if this question is too obvious or has been asked before. I am new to Unix and although I tried to search your forum for the answer to my question, I could not find an answer that would help me.
I have a 500MB csv file with numeric values... (1 Reply)
I was wondering if somebody could help me with something on UNIX. I have a file that looks like this -
"nelson,bill","bill","123 Main St","Mpls","MN",55444,8877,william
I want to replace all comma with pipes (|), except if the comma is within double quotes. (The first field is an example of... (8 Replies)
Hi,
Apologies if this has been asked before, but I searched and was not able to find an answer. It's probably a simple question to answer for those of you with some experience, though...
I have a relatively long string where tokens are separated by the colon (':') character. Let's say the... (10 Replies)
Hi All,
I have huge xml file. The file contains some comment tags . I have requirement to replace comment tag with another comment tag.
Say for example : file X has -- Part of the file
<?xml version="1.0" encoding="ISO-2"?><translationResults jobDate="20070123 23:20:51"... (1 Reply)