- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Special character in flat file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2009 11:47 PM
тАО07-19-2009 11:47 PM
Special character in flat file
I am generating a flat file with some amount fields. I may get positive or negative amount fields where i need to populate the last digit in decimal in a specific format,
For positive amounts:
Value Character
0 {
1 A
2 B
3 C
4 D
5 E
6 F
7 G
8 H
9 I
For negative amounts,
Value Character
0 }
1 J
2 K
3 L
4 M
5 N
6 O
7 P
8 Q
9 R
Is there any convertion method to achieve this?/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2009 01:31 AM
тАО07-20-2009 01:31 AM
Re: Special character in flat file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2009 05:03 AM
тАО07-20-2009 05:03 AM
Re: Special character in flat file
Can you give an exemple of what you want in inbound and outbound of the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2009 05:42 AM
тАО07-20-2009 05:42 AM
Re: Special character in flat file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2009 06:18 AM
тАО07-20-2009 06:18 AM
Re: Special character in flat file
12345
23456
-1234
...
to
1234E
2345F
123M
?
#!/usr/bin/ksh
typeset -i j=0
for i in '{' A B C D E F G H I
do
x_p[$j]=$i
j=j+1
done
j=0
for i in '}' J K L M N O P Q R
do
x_n[$j]=$i
j=j+1
done
while read a
do
b=${a#-}
c=${a%%?}
eval "c=\${a#$c}"
if [ "$b" != "$a" ]
then
echo ${b%?}${x_n[$c]}
else
echo ${b%?}${x_p[$c]}
fi
done