01-28-2010
Help in preserving special characters from input file
Hi Forum.
I've tried to search online for a solution but I cannot seem to find one.
Hopefully, someone here can help me out. I would appreciate it.
Input file abc.txt:
[S_M_F_ING_MTG_COM_CUSTOMER_EXTRACT]
$InputFile_Borrower=CMTSLST\EDW_COMMERCIAL_MTGE_BORROWER_dat.lst
$InputFile_Customer=CMTSLST\EDW_COMMERCIAL_MTGE_CUSTOMER_dat.lst
$OuputFile_BorrowerNoGridID=CMTS\cm_borrower_exception_no_grid_id.out
$OutputFile_BorrowerDup=CMTS\cm_borrower_exception_dup.out
Output from script:
[S_M_F_ING_MTG_COM_CUSTOMER_EXTRACT]
$InputFile_Borrower=CMTSLST\EDW_COMMERCIAL_MTGE_BORROWER_dat.lst
$InputFile_Customer=CMTSLST\EDW_COMMERCIAL_MTGE_CUSTOMER_dat.lst
$OuputFile_BorrowerNoGridID=CMTS$OutputFile_BorrowerDup=CMTS
And here's the simple sample script to read/output the input file:
cat abc.txt | while read -r line
do
echo $line
done
The read "-r" option is suppose to treat the input data as raw, but I think the script is trying to interpret the line $OuputFile_BorrowerNoGridID=CMTS\cm_borrower_exception_no_grid_id.out
.... as \c special character.
I've read that single quotes can preserve the input data as is with no interpretation but I'm not sure how to implement it in my above script.
Thanks.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have a file which has special characters. I can't see them when I "vi" the file. But I am sure there are some special un seen characters. How can I see them?
Please help.
Thx (6 Replies)
Discussion started by: jingi1234
6 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have a data like this in a file,
402003279034002000100147626030003300010000000000002000029000000 ær^M^\MÍW^H
I need to replace those special char to some other char like # or $
Is there any ways to do it...
I tried commands tr,sed and many but it was not able to replace because... (1 Reply)
Discussion started by: solai
1 Replies
3. UNIX for Dummies Questions & Answers
I don't now exactly how I did it, but I created a file named " -C "
cexdi:/home1 $ls -lt
total 1801336
-rw------- 1 cexdi ced-group 922275840 23 mars 10:03 -C
How do I delete this file ?
cexdi:/home1 $rm -C
rm: invalid option -- C
Syntax : rm filename ...
Doesn't work...... (5 Replies)
Discussion started by: yveslagace
5 Replies
4. Shell Programming and Scripting
Environment: Sun UNIX
Language: Bourne Shell
Problem:
I am writing a script that allows user to key in a directory. Example: /root/tmp.
Since the user can key in anything he/she wants, I need to validate to make sure that he/she does not key in anything funny i.e.... (37 Replies)
Discussion started by: totziens
37 Replies
5. Shell Programming and Scripting
Hey Everyone,
I'm quite new to unix (hence the 0 posts!) and im trying to write a simple program that outputs what the user types in to the screen, as long as it is a letter.
This part works fine, however, when a "\" is entered doesnt not display anything and moves to the next line. Is... (11 Replies)
Discussion started by: ultiron
11 Replies
6. Shell Programming and Scripting
I made menu script for users so they can run other script without going in shell just from menu.
But i must control their input.
These are criteria:
Input must have 4 signs
First two signs are always lower case letters
Input shall not have some special signs just letters and numbers
... (1 Reply)
Discussion started by: waso
1 Replies
7. Shell Programming and Scripting
Hello All,
I am facing challenges in order to transfer a file from windows to unix box,the file contains a special character '×' ,now when I am transferring the file from windows to unix that special character converted to something else like 'Ã' ,another thing I have noticed that the hardware is... (1 Reply)
Discussion started by: prarat
1 Replies
8. Red Hat
Hi Guys,
We receive some huge files on to Linux server. Source system use FTP mechanism to transfer these files on our server. Occasionally one record is getting corrupted while transfer, some control characters are injecting into the file. How to fix this issue ? please advice ?
Sample... (2 Replies)
Discussion started by: srikanth38
2 Replies
9. Shell Programming and Scripting
Hi All, I am a newbie to Shell scripting. I have a requirement to Delimit the file fields of a Input file having special characters and spaces with ";".
Input File
----------------------------------
Server Port
----------------------------------
Local ... (5 Replies)
Discussion started by: Suganbabu
5 Replies
10. UNIX for Beginners Questions & Answers
I am trying to rename files with spaces and other characters and not able to be successful.
FileNames:
UPLOAD REFERENCE.xls
UPLOAD MASS REFERENCE.XLS
find /UPLOAD REFERENCE/ -depth -type f -name "* *" -exec rename " " "_" "{}" ";"
The above one is successful to replace spaces... (1 Reply)
Discussion started by: eskay
1 Replies
LEARN ABOUT DEBIAN
asxxxx
ASxxxx(1) General Commands Manual ASxxxx(1)
NAME
ASxxxx - Series of microprocessor cross assemblers for SDCC.
SYNOPSIS
asx8051 [options] file1 [file2 file3 ... file6]
as-gbz80 [options] file1 [file2 file3 ... file6]
as-z80 [options] file1 [file2 file3 ... file6]
WARNING
The information in this man page is an extract from the full documentation of SDCC, and is limited to the meaning of the options.
For complete and current documentation, refer to the ASxxxx Cross Assembler Documentation, available in /usr/share/doc/sdcc-doc/aslink.
DESCRIPTION
The ASxxxx assemblers are a series of microprocessor assemblers. Each assembler has a device specific section.
MCS51 family is supported by asx8051.
Z80family is supported by as-z80.
GBZ80 (GameBoy Z80-like CPU) is supported by as-gbz80.
OPTIONS
The ASxxxx assemblers are command line oriented. The PC assemblers are started with the appropriate option(s) and file(s) to assemble fol-
lowing the assembler name.
-d decimal listing.
-q octal listing.
-x hex listing (default)
The listing radix affects the .lst, .rel, and .sym files.
-j add line number and debug information to file.
-g undefined symbols made global.
-a all user symbols made global.
-l create list output file1.lst.
-o create object output file1.rel.
-s create symbol output file1.sym.
-p disable listing pagination.
-w wide listing format for symbol table.
-z enable case sensitivity for symbols.
-f flag relocatable references by ` in the listing file.
-ff flag relocatable reference by mode in the listing file.
The file name for the .lst, .rel, and .sym files is the first file name specified in the command line. All output files are ascii text
files which may be edited, copied, etc. The output files are the concatenation of all the input files, if files are to be assembled inde-
pendently invoke the assembler for each file.
The .rel file contains a radix directive so that the linker will use the proper conversion for this file. Linked files may have different
radices.
If the list (l) option is specified without the symbol table (s) option, the symbol table is placed at the end of the listing file.
SEE ALSO
sdcc(1), aslink(1), asx8051, as-z80(1), as-gbz80(1).
AUTHOR
This manual page was written by Aurelien Jarno <aurel32@debian.org>, for the Debian GNU/Linux system (but may be used by others).
ASxxxx(1)